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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -