Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

show html string in p tag

const str = `<div>
  <p>1st p tag</p>
  <p>2nd p tag</p>
</div>`

let doc = new DOMParser().parseFromString(str, 'text/html')

console.log(
  doc.querySelector('p').textContent
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #show #html #string #tag
ADD COMMENT
Topic
Name
9+7 =