I'm trying to remove an em dash from a pre made piece of code. However, it is imbedded in the tree and I cannot seem to access it:
HTML:
<span class="price">
<span class="price">
<span class="amount">£8.75</span>
– // I need this!
<span class="amount">£19.20</span>
</span>
</span>
JS:
$('span.price').each(function(){
$(this)
.find('.amount')
.next()
.remove()
var c = $(this);
var t = c.text();
var b = t.replace('—', '@'); // but if i use ('£', '@') it replaces the pound sign
c.text(b);
});
Would anyone know why the above does not find and replace the '—' dash?
-character you had in yourreplace()with this one–: demo.