Below is the Javascript function to create Iframe at any click event of link or button
<script>
function makeFrame(){
var aa = document.getElementById('pdfpath').value;
ifrm = document.createElement("IFRAME"); //will create an Element IFrame
ifrm.setAttribute("src", aa);
ifrm.style.width = 200+"px";
ifrm.style.height = 200+"px";
ifrm.setAttribute("id", "my_iframe");
document.body.appendChild(ifrm);
}
</script>
<script>
function makeFrame(){
var aa = document.getElementById('pdfpath').value;
ifrm = document.createElement("IFRAME"); //will create an Element IFrame
ifrm.setAttribute("src", aa);
ifrm.style.width = 200+"px";
ifrm.style.height = 200+"px";
ifrm.setAttribute("id", "my_iframe");
document.body.appendChild(ifrm);
}
</script>
No comments:
Post a Comment