Js--document object operation content (JS short summary 2)

Source: Internet
Author: User

(iv) Operation contents

1. Form elements. Assignment: Obj.value= ""; Value: var s = obj.value;

2. Non-form elements. Assignment: obj.innerhtml = ""; Value: var s = obj.innerhtml;

1.

A text box, a button, text box input text, click the button, the text on the button is converted into text box input text

2.

Agree with disagree with two radio buttons, a submit button below;

The default is the Do not agree button, the Submit button is not point, is not available, click the Agree button, the Submit button is available.

3.

check box selection, multiple selection, selected, the value of the selected option is added according to the function , the output

Applications that are not form elements

4.

Implement text with alert output in a div layer

5.

Login, enter the account number, password, judge cannot be empty.

6. Implement the button for 9 seconds, not availablein9 seconds

7. Full Select function for check box

First, the form settings inside the body

The following two graphs are all selected JS code,al () slightly different,

( remember: function names must not be keywords, otherwise not available )

8.

Implementation of the drop-down, click on a layer, below the layer appears, pay attention to the CSS, JS writing specifications, do not write the wrong words, error prone.

Click, the drop-down item appears, and then click on the drop-down item to retract.

By this effect, the DIV layer shown is only one, that is, the red area has only one. Click the other blue area continuously to show only the red area below the blue area

9. Browse the image, click on the thumbnail, and the large image is displayed next to it.

Js--document object operation content (JS short summary 2)

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.