Dear All,
I have a page here http://183.78.169.54/tree/2.html. What I want to control is that for link on the left that is clicked I want the text to change to a particular color to highlighted it have been selected. And when another linked is clicked I want the previous linked to be reset to the normal color. How to achieve that.
newbie14
0
Posting Pro
Recommended Answers
Jump to PostHope This Helps
<!DOCTYPE html> <html> <head> <style> a {display:block;} a.clicked { background:#ccc; text-decoration:none; color:#f00; } </style> </head> <body> <ul> <li><a id="" href="#">LINK 1</a></li> <li><a id="" href="#">LINK 1</a></li> <li><a id="" href="#">LINK 1</a></li> </ul> <script type="text/javascript"> window.onload = SetAction(); function SetAction() { var allLinks = document.getElementsByTagName("A"); for (var …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.