(one) JavaScript [DOM html][dom CSS]

Source: Internet
Author: User
Tags visibility

DOM HTML

1 //changing the HTML output stream2 document.write (Date ());3 4 //change the content of HTML5document.getElementById (' box '). InnerHTML = ' box ';6 7 //Changing HTML Properties8 //document.getElementById (ID). attribute=new value9document.getElementById (' gif '). src = "B.gif";Ten  OneConsole.log (document.getElementById (' box '). style);

DOM CSS

1 //Change CSS style2 //document.getElementById (id). Style.property = new Style3 4 //using events, such as HTML onclick= '5 6 //visibility does not change layout7document.getElementById (' button1 '). onclick =function () {8document.getElementById (' box '). style.visibility = ' hidden ';9 };Ten  Onedocument.getElementById (' Button2 '). onclick =function () { Adocument.getElementById (' box '). style.visibility = ' visible '; -};

(one) JavaScript [DOM html][dom CSS]

Related Article

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.