I am having an issue with a single line of javascript/jquery. I am attempting to select all objects with a given class and then create a trigger on another object using the id stored in the first objects class.
The JS/JQ:
$('.navs').click(function(){$("#"+$(this).attr('tab')+"").trigger('click');})
The HTML:
<img alt="" class="thumbnail" src="gamedev_thumb.png" class="navs" tab="gamedev"/>
I am not sure if this matters, but this code is in a page fragment that is loaded into a div on the main page. I have tabs at the top to control navigation, and for simplicity I would like the image to trigger a click on the appropriate tab on top.