Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

decode html entities

function htmlDecode(input) {
  const doc = new DOMParser().parseFromString(input, "text/html");
  return doc.documentElement.textContent;
}

console.log(  htmlDecode("<img src='myimage.jpg'>")  )    
// "<img src='myimage.jpg'>"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #decode #html #entities
ADD COMMENT
Topic
Name
2+3 =