JavaScript | Change the text of a span element – GeeksforGeeks

This post was originally published on this site

Given an HTML document and the task is to change the text of span element. There are two property used to change the content. HTML DOM textContent Property: This property set/return the text content of the defined node, and all its descendants. By setting the textContent property, the child nodes the removed and are replaced by a single text node having the specified string.

Stay up to date
Register now to get updates on promotions and coupons.

Shopping cart

×