I got a class name after I clicked a element in the document. And then I want to select all elements that has this selected class. For example;
$('.tabs1 li a').hover(function(){
var clicked = $(this).attr("class");
// this doesnt work
$('a[class="clicked"]').css("display","block");
});
It’s true that the
classattribute can have multiple values. Like others, I’m guessing to an extent what the poster wants, but this at least allows for multiple classes (and accounts for spaces). If the poster’s wanting to isolate just one of the classes, maybe that’s another question or subquestion:http://jsfiddle.net/szpJb/2/