Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


how to get parameters from a hyperlink using javscript



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> JavaScript Forum
View previous topic :: View next topic  
Author Message
sundarraj_mca



Joined: 14 May 2008
Posts: 19

PostPosted: Sat May 24, 2008 8:16 am    Post subject: how to get parameters from a hyperlink using javscript Reply with quote

hai developers

i have a problem in my site. i used tabbed panel in my site and when ever i click on a hyperlink in any tab when page gets refreshed default tab is displayed. i found that default value is 0 in JS. i kn ow how to handle it, but i dont know how to get values from a href using javascript

how set a value for a href so that in JS i can get that value using getElemetById method
Back to top
View user's profile Send private message Send e-mail
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 715
Location: Cebu City Philippines

PostPosted: Sat May 24, 2008 8:31 am    Post subject: Re: how to get parameters from a hyperlink using javscript Reply with quote

Code:

window.onload=function()
{var lnks=document.getElementsByTagName('a');
   for(var i=0;i<lnks.length;i++)
   {
   lnks[i].onclick=function()
      {alert(this.href);return false;}
   }
}


This code will alert whatever value is inside the href attribute during onclick. See if it helps Wink
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
sundarraj_mca



Joined: 14 May 2008
Posts: 19

PostPosted: Sat May 24, 2008 10:08 am    Post subject: Re: how to get parameters from a hyperlink using javscript Reply with quote

how to know which link is clicked using javscript
Back to top
View user's profile Send private message Send e-mail
rangana
500+ Club


Joined: 27 Feb 2008
Posts: 715
Location: Cebu City Philippines

PostPosted: Sat May 24, 2008 10:13 am    Post subject: Re: how to get parameters from a hyperlink using javscript Reply with quote

What information do you need to show?..and btw, how do we know that the link is clicked?..do you want to alert his chronological order, Example, this is the link 1, this is link2....or you mean something else Wink

I don't get it. I'm confused (nothing new) Rolling Eyes
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> JavaScript Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap