Click on an element hightlights other element

snaider_beck

New Member
Is there any way to change the attributes of an element when clicking on another element? For example, consider this approach where I have a link like so:\[code\]<a href="http://stackoverflow.com/questions/15702323/#100">Click me!</a>\[/code\]And then close to it I have this:\[code\]<span id="100" class="clickTarget">Important text</span>\[/code\]And then on my css file I have this:\[code\].clickTarget:target { color: #4f8dd5;}\[/code\]That means whenever the link is clicked, \[code\]Important text\[/code\] changes its color. The problem with this approach is that the page is also scrolled even if only a bit. Is there any other way to do this that doesn't scroll the page?You can use jQuery if you see fit.
 
Back
Top