PHP Basic Class Beginner's experience: JS in inner some understanding

Source: Internet
Author: User

I just participated in basic PHP training, because there is no foundation, the experience of sharing may not be standardized, the method may also "heterodoxy", can not guarantee the quality, only for their own summary of learning, but also hope to help the same beginner friends, and common progress.

Here to share some of our basic class students encounter some of the doubts and my analysis. PS: Analysis is not necessarily correct, hope peer advice

One: Inner

  1. Such as:
  2. <div id="Test" >
  3. <span style="color:red" >test1</span> test2
  4. </div>
  5. In JS, you can use:
  6. Test.innerhtml:
  7. That is, the entire contents of the object from its starting position to the terminating position, including the HTML tag.
  8. The value of test.innerhtml in the example above is "<span style=" color:red ">test1</span> test2".
  9. Test.innertext:
  10. The content from the starting position to the terminating position, but it removes the HTML tag
  11. The value of text.innertest in the example above is "Test1 test2", where the span tag is removed.
  12. Test.outerhtml:
  13. In addition to the entire contents of the innerHTML, the object label itself is included.
  14. The value of text.outerhtml in the above example is <div id="test" ><span style="color:red" >test1</span> test2</ Div>

Experience: Inner is used as a property of a variable, the inside innertext is only IE browser insight, in addition, such as innerHTML can be set, if Innerhtml= "xxxx", this XXXX will replace the content of innerHTML selection

PHP Basic Class Beginner's experience: JS in inner some understanding

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.