In jquery, the operations of various controls on the cyclic page are often used. The common cyclic operations are as follows: // All div labels starting with weiguo _ id on the cyclic page $ (& quot; div [id ^ weiguo _] & quot ;). each (function (index) {// obtain the content variDValue In the div $ (this ). text ()...
In jquery, the operations of various controls on the cyclic page are often used. The commonly used cyclic operations are as follows:
// All div labels whose id starts with weiguo _ on the cyclic page
$ ("Div [id ^ = weiguo _]"). each (function (index ){
// Obtain the content in the div
Var iDValue = $ (this). text ();
// If this cycle meets the conditions, the cycle will jump out immediately.
If (iDValue = 0 ){
CheckMark = false;
BlankTextArray. push (idval );
// Break ---- identified by return false syntax
Return false;
}
}
Notes
Break and continue cannot be used in the each code block. To implement the break and continue functions, use the following method:
Break ---- return false;
Continue -- use return ture;
Therefore, if you want to return false or true in a jquery loop, you must note that the written statements may not be what you want.
From Wei Guo's column