Jquery text box loses focus to get the value of the current text box and the value of the hidden field
My js level is a little poor. It took 3 minutes to get the focus of a text box and the value of the corresponding hidden domain. Hi .. I would like to express my high respect to those js and jquery experts. Here, I will post the implementation code to the unknown codefans for a look. This applies to the loop list and dynamically changes the arrangement order.
Html code
<Script src = "http://code.jquery.com/jquery-latest.js"> </script>
<Ul id = "px1">
<Li>
<Input type = "text" value = "11" size = "5" name = "zs"/>
<Input type = "hidden" value = "5" name = "hidd"/>
</Li>
<Li>
<Input type = "text" value = "12" size = "5" name = "zs"/>
<Input type = "hidden" value = "6" name = "hidd"/>
</Li>
<Li>
<Input type = "text" value = "13" size = "5" name = "zs"/>
<Input type = "hidden" value = "7" name = "hidd"/>
</Li>
<Li>
<Input type = "text" value = "14" size = "5" name = "zs"/>
<Input type = "hidden" value = "8" name = "hidd"/>
</Li>
</Ul>
Jquery code
<Script>
$ ("Document"). ready (function (){
$ ('# Px1 li'). find ("input [name = zs]"). blur (function (){
Var zs = $ (this). val ();
Var uid = $ (this). next ("input [name = hidd]"). val ();
Alert (zs );
Alert (uid );
});
});
</Script>