javascript - How can I say this in jQuery? -
javascript - How can I say this in jQuery? -
i want append text after 2 closing divs sector element.
<a href="" class="thingiclicked">click me</a> </div> </div> // want append text
my code appends text after link. how can "append after 2nd closing div"?
$('a.thingiclicked').click(function() { $(this).append('hello'); });
there's more elegant solution, how about:
$('a.thingiclicked').click(function() { $(this).parent().parent().after('hello'); });
edit: @zack right (and should reply credit one) - original code have added text into sec enclosing div
, rather after it. i've edited code above accordingly.
javascript jquery
Comments
Post a Comment