How to change the icon path while click on parent link using prototype?
<a onclick="toggleAmenity('park'); return false;" href="#">
<input type="image" id="parks_button" src="/images/amenities/icon_parks.gif" name="commit">
</a>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are about a million ways to skin this cat, but this might give you some ideas using some Prototype stuff.
Instead of ‘amenity’ I’m using image size. Kinda confusing, but I wanted to show a visual change on click. I’d strongly advise against using onclick attributes for this type of thing (or most any other type of thing).
http://jsfiddle.net/gSfmL/
.