I have the HTML code, and I need to do the decimal substitution at the end of the div, the project is doing a reverse proxy for a site, and I have to put the value of the "changed" tag in the place where the "11.00 " the HTML is this:
<div class="osg-outcome__price" changed="7.14">
<i class="osg-outcome__trend"></i>
11.00
</div>
I have tried to do this as follows:
var value = parseFloat($(this).text());
var ht = $(this).html().replace(value,$(this).attr("changed"));
$(this).html(ht);
But the problem is that the div value constantly changes based on a websocket, so when I change the value that way, the websocket stops updating the div for some reason.
The maximum I could get was to put the value of interest inside the 'changed' tag, now I need to take that value to div without touching <i class="osg-outcome__trend">
.
Is there a way to do this in CSS? I think I would avoid those problems. Or a more accurate jQuery solution?