This javascript code from RoToRa does what I want:
http://jsbin.com/ayoqem/7/edit#javascript,html,live
What jQuery code will do the same task? Which is better?
This javascript code from RoToRa does what I want: http://jsbin.com/ayoqem/7/edit#javascript,html,live What jQuery code will
Share
Sure, if you don’t need to use jQuery then the javascript you have already will do just fine. But if you are using jQuery then you can accomplish the same task with just 3 lines of code.
http://jsfiddle.net/RWzQT/1/
Note, that I also removed your inline javascript (
onclick="hlt_showhide(this)") from the HTML.