...

View Full Version : getting href info dynamically



turn
12-04-2009, 04:38 AM
Can anyone let me know how can I get the href info dynamically

I have 2 different webistes, just want to show those website urls dynamically


<html>
<body>
<a href="http://www.yahoo.com" target="_blank">YAHOO</a>
<a href="http://www.Google.com" target="_blank">Google</a>

<script type="text/javascript">
document.write(href url of yahoo);
document.write('href url of google);
</script>
</body>
</html>

thanks for help in advance

abduraooft
12-04-2009, 09:50 AM
<html>
<head>
<script type="text/javascript">
window.onload=function(){
var links=document.links;
var div=document.getElementById('mydiv');
for(var i=0;i<links.length;i++)
div.appendChild(document.createTextNode(links[i].href))
}
</script>
</head>
<body>
<a href="http://www.yahoo.com" target="_blank">YAHOO</a>
<a href="http://www.Google.com" target="_blank">Google</a>

<div id="mydiv"></div>
</body>
</html>

turn
12-04-2009, 04:17 PM
thanks abduraooft, now i can able to get the href info
i have to tweek for my final resultset
cool..this site is really helpful



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum