0
<a href="?id=home">Home</a>

is there any option available in Javascript for getting value of "?id=home" ????

2
Contributors
4
Replies
6
Views
5 Years
Discussion Span
Last Post by vizz
0

in php I get value "home" for this, <a href="?id=home">Home</a>

How to get "home" using javascript?

of course there is, what part of it do you need exactly?

0

The thing you are getting there is the text content of the link element - it seems{?}
and it is a lot easier to strip correctly.
And, it is valid and usable for as long as the link inner-text values are correct as well.
In that case a simple line of code will do your thing:

lnk = document.links['linkId'].innerHTML; //the following is, sport.
alert(lnk);  // >> "Home"
delete lnk; //[*]as soon as your'e done using it.

* because undeclared variables are erasable: meaning "green"; "biodegradable", environmentally friendly and pollution free.

0

Thanks..!!!

The thing you are getting there is the text content of the link element - it seems{?}
and it is a lot easier to strip correctly.
And, it is valid and usable for as long as the link inner-text values are correct as well.
In that case a simple line of code will do your thing:

lnk = document.links['linkId'].innerHTML; //the following is, sport.
alert(lnk);  // >> "Home"
delete lnk; //[*]as soon as your'e done using it.

* because undeclared variables are erasable: meaning "green"; "biodegradable", environmentally friendly and pollution free.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.