1
I’m trying to add a simple iframe to an html page, but it’s not working:
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", "http://www.google.com/");
document.getElementsByClassName('col-12 col-md-4').appendChild(ifrm);
HTML:
<body>
<div>
<div class="col-12 col-md-4">
</div>
</div>
</body>
Excellent. And how would I style this iframe direct from js?
– Diego Cândido
@Diegocândido https://stackoverflow.com/questions/5927012/javascript-createelement-style-problem take a look!
– novic