I have an image, onclick on which I make some ajax requests.
I need to pass a variable from $_GET[] to my onclick function, so I decide to do the following:
<img id="img1" class="<?=$_GET['value']"?> />
and jQuery
$("#img1").click(function()
{
// how can I get the class value here?
});
pretty easily
FYI there are also dedicated class methods in jquery, such as addClass(), removeClass(), hasClass() & toggleClass()