What is inner HTML in javascript?
Question
Share
Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
InnerHTML is a property of every element. It tells you what is between the starting and ending tags of the element, and it also let you sets the content of the element.
innerHTML will show the value and apply any HTML formatting.
Ex:
HTML:
js:
ouput:
(in h1 style) innerHTML apply any HTML formatting in string.
InnerText:
InnerText wont apply HTML formatting
ex: