- 2
what is the different between innerHTML and textContent
in JAVASCRIPT
2 Answers
+ 1
The textContent property: This property is used to get or set the text content of the specified node and its descendants.
The innerHTML property: This property is used to get or set the HTML content of an element.
see an example here - https://www.geeksforgeeks.org/difference-between-textcontent-and-innerhtml/
+ 1
The text output with innerHTML can be formated with HTML / CSS statements. This example shows it:
https://code.sololearn.com/WKzTAH2PqetR/?ref=app