在弹出窗口中放置一个链接

时间:2015-12-31 17:14:04

标签: javascript hyperlink popup

我正在尝试通过弹出按钮建立链接。

 <button onclick="myFunction4()">Resist Elements</button>
 <script>
        function myFunction4() { 
            var myWindow = window.open("", "MsgWindow", "toolbar=yes, scrollbars=yes, 
                resizable=yes, top=500, left=500, width=400, height=400");

            myWindow.document.write("<b>Resist Elements:</b> At 2nd level, druids gain a +2 bonus to saving throws against fire, water, earth, air, cold and lightning attacks. ");
        }
</script>

例如,我希望“攻击”这个词链接到某些内容,例如http://www.google.com。每次我输入一个特定按钮都不会打开的href。

0 个答案:

没有答案