Beginner Question About Toggling Values
OK, I've used JavaScript at different times on different levels, and I can get it to do most anything I need. I've never used JQuery,and I'd like to get started with it.
I see a toggle function, and I'd like to use it, but what I see is toggleClass. What I need to do is even simpler. I'd like to toggle an id.
I'm going to have pairs of two tags like this
- <img class="inactive" src="img.png" />
- <input type="hidden" id="12345" name="12345" value="inactive" />
When someone clicks on the image, I would like to change the corresponding input tag to hidden.
That makes me think, from doing js, I would want to do something like this:
- <img class="inactive" src="img.png" onclick="toggleValueOfID('12345'); toggleClassOfSelf();" />
- <input type="hidden" id="12345" name="12345" value="inactive" />
JQuery, from my quick reading, doesn't seem to be called by onclick, but I'm guessing it could be. But, I don't see how to pass values to it.
I think if I could figure out this basic problem, I'd be able to figure out most everything else on my own.
Thanks for reading and any help you can provide.