What is the purpose of innerHTML?

Posted by Jessica Taylor | Updated on

The innerHtml is a property of HTML-Elements, which allows you to set it’s html-content programmatically. Let’s display the below html code snippet in a

tag as below using innerHTML binding,

and define the htmlSnippet property from any component

Unfortunately this property could cause Cross Site Scripting (XSS) security bugs when improperly handled.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers