Click and unclick with jquery -


when click in div class="in" want add span inside div class="in" , add background-color.

when click on element that's outside div class = "in" want remove added span , css.

how it?

what one:

$(".in").click(function(event){   event.stoppropagation();     var span = $("<span>my new span</span>").css('background-color', 'yellow');     $(this).append(span); });  $(".outer").click(function(event){     $(this).find('.in span').remove(); });  

have @ example http://jsfiddle.net/va2fp/1/


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -