...
You can use DOM manipulation API of javascript to do so.
We have implemented an iframe as an example (Github link given on top). You can click increaseSessionTime
to make that iframe visible. Check the /js/eventHandler.js
file.
Check the following links and examples:
https://www.w3schools.com/js/js_htmldom.asp
https://www.w3schools.com/jsref/met_document_createelement.asp
...