Answers for "Remove style attribute on style tag by regex"

0

Remove style attribute on style tag by regex

var string = `Hello <span style="font-size: 10px; color: red;">Tom</span>`

var s = string.replace(/style="[^"]*"/g, '')

console.log(s); //Hello<span >Tom</span>
Posted by: Guest on January-26-2022

Browse Popular Code Answers by Language