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
- Such as:
- <div id="Test" >
- <span style="color:red" >test1</span> test2
- </div>
- In JS, you can use:
- Test.innerhtml:
- That is, the entire contents of the object from its starting position to the terminating position, including the HTML tag.
- The value of test.innerhtml in the example above is "<span style=" color:red ">test1</span> test2".
- Test.innertext:
- The content from the starting position to the terminating position, but it removes the HTML tag
- The value of text.innertest in the example above is "Test1 test2", where the span tag is removed.
- Test.outerhtml:
- In addition to the entire contents of the innerHTML, the object label itself is included.
- 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