jQuery addClass example
Change class name on click in jQuery
HTML
<div id="content"></div>
JavaScript
const str = `<p>content</p>
<p>another paragraph</p>
<a href="https://example.com/about-me.html?q=23424">about me</a>
<br />
<a href="https://example.com/blog-link-1.html?q=123">blog</a>`
const result = str.replace(/https.*.html/g ,function(a) {
return a //what to do here?
})
console.log(result)
$('#content').html(result)