Home >Web Front-end >JS Tutorial >js innerHTML method to change div content_javascript skills
Changing the text innerHTML
Every HTML element has the InnerHtml attribute that defines the text that occurs between the HTML code and the element's opening and closing tags. By changing an element's innerHTML after some user interaction, you can make your web page more interactive.
However, using innerHTML requires some preparation if you want to be able to take advantage of it easily and reliably. First, you must give the ID card that you want to change. With the identifier in place, you will be able to use the getElementById function, which works in all browsers.
After you think about establishing the elements you can now manipulate the text. To get started, let's try changing the text to a bold marker.
Let’s take a look at using innerHTML of js to change the div value.
Welcome to the site dude