Java Web notes: use Javascript to operate DOM and javascriptdom

Source: Internet
Author: User

Java Web notes: use Javascript to operate DOM and javascriptdom

In HTML, because it uses the markup language, you can use Javascript to operate the DOM in HTML.

Using DOM parsing in Javascript defines a common button in the form. When you click this button, the show function is called to obtain the info element in the show function, and set the display content.

<Html xmlns = "http://www.w3.org/1999/xhtml"> 

Use DOM to generate a drop-down list box. In the setFun method, use document. getElementById ("area") obtains the object in the area drop-down list box. Then, you can select only one drop-down list box through length setting and set the first option to the default one. There are multiple options in the drop-down list. Therefore, you can use the setArrribute () method to set the value attribute content contained in each option, and set a text node in each option to indicate the displayed content, add each element to the drop-down list.

<Html xmlns = "http://www.w3.org/1999/xhtml"> 


Dynamically add and delete tables
<Html> 



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.