I am using xslt and javascript to show a table of data. One of my pieces of table data is an image which i am using as a button, this button is in a for-each tag so it appears
in each instance of data from the xml. I use jquery to hide this button when clicked on to inturn show more button links
which work fine, the only problem is it does this for every button on the page when i want to apply this to only the
image being clicked. How can i work around this problem considering i am working on an xsl file, so each button will not
have a unique id due to the for each tag?
for some more background info, I used the class attribute and selected it in jquery but am open to implementing a different solution altogether.
Any help is greatly appreciated,
Thanks in advance
Assuming you have the handler for the
button, you should use$(this).hide()instead of$('.buttonclass').hide()Basically inside the handler, use
thiswhich is the element that triggered the event. Using which you can access the corresponding element, element’s parent, siblings and so on..