Hey guys, I’m not sure if that’s possible but I ‘m trying to somehow make this code to get more than on element id instead of just one Id. Here’s what I have:
Anyone knows how to do this?
Maybe any alternative ways?
There are a lot of ways to do this, but the easiest of all would be to use document.getElementsByClassName instead of ID
That’s if it’s possible to add classes in your scenario
I tried different ones like .getElementsByClassName .getElementsByName but it only works for “id” (for one element).
The thing is I have the individual id’s for separate images in a table.
And when clicked on a link(s) using the code above I want to make multiple elements disappear/appear.
Any other suggestions? But thanks for the help anyway
I was thinking of a for loop to do it but I hit a brick wall
Can anybody see where I went wrong?
Hide 1 and 3
Figured it out :)
Thank you so much! This works great, but there is only one little problem, how do I apply this to hide id1 and id3 using one button and then hide id2 using another button?
I hope I’m not taking too much of your time.
Hide 1 and 3
Hide 1 and 2
Hide 2 and 3
slight rework, not sure if its the best way, but it works :D
You must be logged in to reply to this topic.