A question I encountered during the interview a few days ago. My answer is one to create the label and the other to create the text content. But the answer the interviewer wants is not this, so what direction should I think about?
漂亮男人2017-05-16 13:39:20
Think about the composition and characteristics of nodes in the Dom tree structure:
Node is the root node, and both ElementNode and TextNode inherit from it.
ElementNode corresponds to the tag form, such as , it can have its own attributes: such as href, title, etc. There will also be child elements, such as another Element or Text
TextNode, as the name suggests, is a text node. It is expressed in the form of text. It does not have child nodes and has no additional attributes.