Have a div

<div id="wre" style="padding: 5px;border: 1px solid #000;" >text</div> 

How to make sure that when you lose focus, the text in this div changes? for example, if I click on this div, then nothing will happen, and if I click behind its chapels, the text will change there

    2 answers 2

    Not?

     $('body').click(function() { $('#wre').text('New text'); }); $('#wre').click(function(event){ event.stopPropagation(); }); 

      Do you need exactly this sequence? That is, changes occur only after clicking on this element and then outside it? If yes, then there is such an option .

      • no) so I myself can) - aleksejloshin
      • one
        @lisinskiy, can you tell us more about what you would like as a result? And what you can not do yourself? - Deonis