Can I, and how would I use js to modify the href in an anchor?
<td class=’nav2t’ id=’LOC1′>
<a href=”javascript:doThis(‘LD1′)” name=’LD1’>LOC 1</a></td>
I can modify the innerHtml with
document.getElementById(LOC1).innerHTML=’new loc 1′
but nothing I try to modify the href to say javascript:doThat(‘LS1’) seems to work. Also, when I modify the innerHTML the original href doesn’t even work.
tried
document.getElementsByTagName(“a”).LD1.href=javascript:doThat(‘LS1’);
and
var anchors = document.getElementsByTagName(“a”);
anchor=anchorsÝi¨;
anchor.setAttribute(“href”,”javascript:doThat(‘LS1’)”);
any direction would be appreciated. Thanks