Quickest way to escape HTML to String
•
1 min read
Here the code:
const esc = (v) => {
var escape = document.createElement('textarea')
escape.textContent = v
return escape.innerHTML
}
Found it here.
Here the code:
const esc = (v) => {
var escape = document.createElement('textarea')
escape.textContent = v
return escape.innerHTML
}
Found it here.