Reputation: 1
I want to replace or remove this special character ">" from my text with Jquery.
ex. <div class="test">></div>.
Thank you in advance.
Upvotes: 0
Views: 41
Reputation: 15122
Just empty the text of the div.
$('div.test').text('');
or If you want to keep the other text intact, use like below.
var $div = $('div.test');
var str = $div.text();
$div.text(str.replace(/>/g, "")); //replaces all occurrences of > and assign again
Upvotes: 1