Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-04-2009, 03:38 AM   PM User | #1
turn
New to the CF scene

 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
turn is an unknown quantity at this point
getting href info dynamically

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
turn is offline   Reply With Quote
Old 12-04-2009, 08:50 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Code:
<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>
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 12-04-2009, 03:17 PM   PM User | #3
turn
New to the CF scene

 
Join Date: Dec 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
turn is an unknown quantity at this point
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
turn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:41 AM.


Advertisement
Log in to turn off these ads.