Jquery load DIV inside another DIV at same page
- by Sergio
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?