I want to create a filter that replaces inappropriate words and changes the background color using JavaScript. Here is what I have so far:
$(document).ready(function () {
$('body').html(function(i, v) {
return v.replace(/bad/g, 'CENSORED');
});
});
However, I'm unsure of how to change the background color where I replaced the inappropriate words.