making the link variable when loading an iFrame with JS

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前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏