开发者

How to go about setting a xml node as link

开发者 https://www.devze.com 2023-03-11 07:58 出处:网络
document.getElementById(\'num1\').innerHTML = homestead[0].textContent; document.getElementById(\'num3\').innerHTML = homestead[1].textContent;
document.getElementById('num1').innerHTML = homestead[0].textContent;
                    document.getElementById('num3').innerHTML = homestead[1].textContent;



    }
            </script>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>


    <table width="500" border="0">
      <tr>
        <td><b>Stream Name:</b></td>
        <td><b>Viewers&开发者_JAVA百科lt;/b></td>
      </tr>
      <tr>
        <td id="num1">&nbsp;</td>
        <td id="num2">&nbsp;</td>

homestead is a node value from an xml sheet, and the script put it in the table .. i want to write a script to call the url (another node from xml) and use it as a link for homestead. any suggestions?


I'm pretty confused as to what you're asking, but if you're just talking about adding a link to the table, you need to use an <a href="[url]"> tag:

document.getElementById('num1').innerHTML =
  '<a href="' + homestead[0].textContent + '">Link</a>';
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号