javascript - Onblur event is not firing for first time -


I have an application, I need to update the number, for this, I have planned, when I number Clicking on the container, Iam is converting it to an input field with jquery, then on the stigma I want to turn it off as plain text inside the container divan and then trigger the AJAX to update it in DB Want to do it, but first time the blur also trig No, I mean, if I click at the forst time for the number, then it is converting it to the input field, and when I click outside (blur also), the blur function does not work If I click again and click on the outside, then it's okay.

Here is my code

  & lt; Div onclick = "wrap ($ (this))" & gt; 999999999 & lt; / Div & gt; & Lt; Script & gt; Function wrap (sel) {sel.html ('& lt; input onblur =' open ($ (this)); "value =" '+ sel.html () +' "/" gt; '); Sel.attr ('onclick', ''); } Open the function (child) {warning ('unverifying'); } & Lt; / Script & gt;  

Any help / suggestions will be helpful.

This is because when you first click on div , input Box is not given focus. Without focus, there is no blur, after making it, try to focus it ...

  Open the function wrapper (sel) {sel.html ('& lt; input onblur =' $ ("$"); "Value =" '+ Sel.html () +' "/ & gt; '); Sel.attr (' onclick ',' '); $ (" input ") focus .;}  

Object:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -