I have a string txt1
that stores an image. Its value is in XHTML format, that is, the element is closed: . But I need to remove that closing slash so it can be
just like in HTML5.
Is there a way to do this.
P粉4470021272023-09-07 10:26:00
const txt1 = '<img src="happy.gif" alt="Happy face" />'.replace('/>', '>'); console.log(txt1)