Jquery Test Error Correction notes, jquery Error Correction notes

Source: Internet
Author: User

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 ---------------------------------------------------------------------------------------------------------

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.