Have same js code:
$("#pr_list .c").bind({
click: function(event) {
var m = $(this);
var u = m.attr("rel");
var lOpen = $("div.txt[rel="+u+"]");
lOpen.html("!!!").slideDown();
}
});
Have same html code
<div id="pr_list">
<div class="w c" rel="1">same text</div>
<div class="txt" rel="1" style="display: none;"></div>
<div class="w c" rel="2">same text2</div>
<div class="txt" rel="2" style="display: none;"></div>
</div>
When click on "same text" opens all div with class txt, not check same rel attr.. why?
Update: Ок, how about real example: http://jsfiddle.net/3nYXA
Your code has problem in here.
You should change this to:
Quotation marks were missed. It was fine at jQuery 1.4.x, but from jQuery 1.5 it doesn't work.
Check this out. http://api.jquery.com/category/selectors/attribute-selectors/