Can anyone help me this one? When I try to replace the currency symbol on this it moves the symbol inside the span tag which is causing problems with the rest of my code.
I've added my code to jsbin here: http://jsbin.com/usuraw/2
Thanks
<select id="inv_currency">
<option value="£">£</option>
<option value="€">€</option>
</select>
<span class="invE_balance currency">
£
<span>0.00</span>
</span>
JS:
$('#inv_currency').on('change', function() {
var currency = $('.currency');
if ($(this).val() == 'pound') {
currency.each(function( index ) {
var text = '';
text = $(this).text();
text = text.replace("€", "£");
$(this).text(text);
});
}
else {
currency.each(function( index ) {
var text = '';
text = $(this).text();
text = text.replace("£", "€");
$(this).text(text);
});
}
});