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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -