Jquery Test Error Correction notes, jquery Error Correction notes
I,
Resolution:
The order of retrieved element ranges is as follows:
$ (# One). siblings ("div") >$ ("# one ~ Div ")> $ (" # one + div ") or $ (# one ). siblings ("div") >$ (# one ). nextAll ("div") >$ (# one ). next ("div ")
Bytes -------------------------------------------------------------------------------------------
Resolution:
The jQuery content operations (html (), text (), val (), and text () methods cannot operate the value of the Form. Therefore, select d.
Bytes ------------------------------------------------------------------------------------------
Resolution:
Use slideUp () and slideDown () of jquery. Both methods can change the height of the element. slideUp () is used to shorten the hidden element from bottom to top, and slideDown () is used to show the element from top to bottom.
Bytes ------------------------------------------------------------------------------------------------
Resolution:
Jquery moves the effect up and down with the scroll bar. The code first gets the distance from the scroll bar to the top and left of the page, and then assigns the two distances to the div whose id is editinfo, in this way, the div moves up and down with the scroll bar.
Bytes ----------------------------------------------------------------------------------------------------------------
Resolution:
The drop-down box links the drop-down and display sequence of special effects. All cities should be hidden, and the drop-down list with id = guangdong should be displayed.
Bytes -------------------------------------------------------------------------------------------------------
Resolution:
The array length in JavaScript is not fixed. When the array member exceeds the length of the array, it is automatically expanded.
Bytes -------------------------------------------------------------------------------------------------------
Resolution:
Option A is incorrect. The onsubmit event is triggered, the submit is A method, the option B is incorrect, it should be the val () method, and the option D is incorrect.
Bytes --------------------------------------------------------------------------------------------------------
Resolution:
The text () and val () Methods of jQuery objects. The text () method can get the text content, and the val () method can get the value attribute value.
Bytes -------------------------------------------------------------------------------------------------------
Resolution:
In option B, jQuery objects cannot directly use the methods and attributes of DOM objects. In option C, the methods should be hide (). Option D is the same as option B.
Bytes --------------------------------------------------------------------------------------------------------
Resolution:
1. The declaration of variable I in the for loop is incorrect. The correct format is:
For (Var I = 0; I <s. length; I ++ ){
2. The words in the statements written to the page are incorrectly spelled. The correct format is:
DocUMent. write (s );
Bytes ------------------------------------------------------------------------------------------------------
Resolution:
The Application of toggleClass () in jQuery. As required by the question stem, click the cyclic switching style to use toggleClass (). Therefore, the use of toggleClass () in A and B is incorrect, and the addClass () can only append the style, style cannot be removed, and does not match the question stem. In C, toggle () is used to show and hide elements cyclically. In D, addClass () can only append styles, but cannot remove styles, non-conforming question stem
Bytes -------------------------------------------------------------------------------------------------------
Resolution:
The combination of the node Traversal method parent () and next () in jQuery. A meets the question stem requirements. Therefore, selecting A and B as the mouseout event indicates that the mouse is removed, and neither C nor D can obtain the div element.
Bytes ---------------------------------------------------------------------------------------------------------