Can you remove specific content from an element with jQuery?
So for example, if I had
<p>Hello, this is a test</p>
could I turn it into
<p>this is a test</p>
with jQuery (or any Javascript)
Please keep in mind that I just want to remove the "Hello, " so
$(p).innerHTML("this is a test");
wont work
var str = $('p').text()
str.replace('Hello,','');
$('p').text(str);
For more information visit: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With