How to read the Selected HREF text

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

stephenrodrics
New php-forum User
New php-forum User
Posts: 58
Joined: Thu Mar 14, 2013 6:10 am

How to read the Selected HREF text

Postby stephenrodrics » Mon Apr 08, 2013 5:23 am

How can I read the HREF Text , suppose the above shown PHP coding => General is label of my HREF i want to display general page once user clicks on it.

I also want to validate it for validation I need to read back the text of the selected HREF item.

how can I do so

I have one sample shown below it returns www.yahoo.com but I want the text, which is Selected text, how to get that

<a onclick="alert(this.getAttribute('href'))" href="www.yahoo.com">selected text</a>

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: How to read the Selected HREF text

Postby johnj » Mon Apr 08, 2013 6:55 am

Read this, there is an example in this post http://phillipnb.wordpress.com/2012/12/ ... es-part-1/


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest