i want replace the symbol "_" with a space in a div class,
this is a example :
<div class="textreply">
my_names_is_mark
</div>
i want replace with this :
<div class="textreply">
my names is mark
</div>
i have already build 2 script like this :
1:
jQuery(document).ready(function(){
jQuery(".textreply").text(function () {
return jQuery(this).text().replace("_", " ");
}); });
2:
$('.textreply').each(function() {
var text = $(this).text();
$(this).text(text.replace('_', ' '));
});
the problem with this 2 script is to replaced only the first "_" of word
example this :
my names_is_mark
and not continue .
how replace every "_" ?