iframe html javascript code example

Example 1: html iframe tag

<iframe src="http://kidcreatorsteam.com" height="90px" width="40px"></iframe>
<!--I made an iframe! Yay! -->

Example 2: what is iframe html

<div id="website_Within_Same_Webpage">
	<iframe src="https://www.codegrepper.com" 
        	height=200px width=100%>
	</iframe>
</div>

Example 3: iframe in html

<iframe src="yourURL" height="200" width="300"></iframe>

Example 4: document.createElement('iframe');

var ifrm = document.createElement('iframe');
ifrm.setAttribute('id', 'ifrm'); // assign an id

//document.body.appendChild(ifrm); // to place at end of document

// to place before another page element
var el = document.getElementById('marker');
el.parentNode.insertBefore(ifrm, el);

// assign url
ifrm.setAttribute('src', 'demo.html');