Jquery load DIV inside another DIV at same page
Posted
by Sergio
on Stack Overflow
See other posts from Stack Overflow
or by Sergio
Published on 2010-06-11T11:18:34Z
Indexed on
2010/06/11
11:22 UTC
Read the original article
Hit count: 277
jQuery
HTML:
<div class="someclass" rel="first">text 1</div>
<div class="someclass" rel="second">text 2</div></div></div>
<div class="info_ly">here is some text</div>
<div class="first" > the first DIV </div>
<div class="second" > the second DIV </div>
CSS:
.first{ display:none}
.second{ display:none}
Jquery:
$(".someclass").click(function() {
$(".info_ly").html($(this).attr('rel'));
});
I want to call and load the "rel" DIV inside "info_ly" DIV.
With this Jquery code I get only text "first" or "second" inside "info_ly" DIV.
How can I load the DIV with the class "first" or DIV with the class "second" inside "info_ly" DIV?
© Stack Overflow or respective owner