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.
txt1
Is there a way to do this.
const txt1 = '<img src="happy.gif" alt="Happy face" />'.replace('/>', '>'); console.log(txt1)