steave ray
answered Sep 25 '21 00:00
There is a typo error in the above code, getElementById() use instead of the getElementbyId() function.
getElementById() is function used to get element by id , you need to provide id of the element to the getElementById() function and it will return object of that element.
changed and correct code is as below :
document.getElementById('id').innerHtml='new';