The easiest way to modify the content of an HTML element is by using the innerHTML property.
The HTML document above contains a
element with id=“p1”
We use the HTML DOM to get the element with id=“p1”
To know more about this visit at: https://www.cetpainfotech.com
Your question seems to be less informative. If you can share the HTML/JS code that would describe the problem in detail.
But I faced a similar issue hence posting this answer,
Recently I was on this topic “Manipulating HTML content using JS” and I was trying to run the program but my output was not as expected. So, turns out that the HTML code for this topic in the course has a tag misplaced. They have closed the second paragraph tag before the script tag. Hence the paragraph tag is unable to call your java script file which is called using tag .
By doing so, I got the expected output .
Hope this information was helpful.