I want to load an HTML page into an iFrame with JS instead of using the usual iFrame target. Long story. That's just how I need it to be. My Javscript is
onclick = function buttonLife() {
var el=document.getElementById("divContent");
el.innerHTML="";
}
And my HTML is:
BUTTON;
And it works. But it loads a page already defined by the above java function. However, if I want to make the page I load into the iFrame variable for each button with the following HTML:
BUTTON2
I know I need to change the have function to something like
onclick = function buttonLife() {
var el=document.getElementById("divContent");
el.innerHTML="";
}
But it doesn't work. Help! Thanks
以上就是making the link variable when loading an iFrame with JS的详细内容,更多请关注web前端其它相关文章!