Value,innerhtml,innertext,textcontent Property

Source: Internet
Author: User

Value is the value owned by the label with the Value property. is generally the attribute of a single closed tag. (value can be assigned or obtained)
The innerHTML property, a double-closing label between two tags. (identification tag) (can be assigned, can also get values)
The InnerText property, a double-closing label between two tags. (does not recognize tags) (can be assigned, can also get values)
The Textcontent property is similar to InnerText and the old version of Firefox supports this property (no old version, not printed). (value can be assigned or obtained)
<! DOCTYPE html>Hello</div> <div id= "Box2" > <ul> <li> I am the InnerText property gets the value </li> &LT;/UL&G THello</div> <script>Console.log (document.getElementById ("INP"). Value) Console.log (document.getElementById ("Box"). InnerHTML); //document.getElementById ("box"). InnerHTML = "<li> I am the li</li> of the assignment";Console.log (document.getElementById ("Box2"). InnerText); </script></body>

Value,innerhtml,innertext,textcontent Property

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.