href
Hi,
How do you access the href of a link? Say I ahve this table (which will have a lot more links)... how do I get the bloody '#'???
function linkTest()
{
tables = document.getElementsByTagName("table");
var table = tables.item(2);
var rows = table.getElementsByTagName("tr");
row = rows.item(0);
var cells = row.getElementsByTagName("td");
-> alert (cells.item(0).innerHTML.href);
}
<table>
<tr>
<td><a href="#" onClick="linkTest();">Test</a></td>
</tr>
</table>
|