0
I have the HTML code, and I need to replace the decimal value at the end of the div, the project is doing a reverse proxy of a site, and I have to put the value of the tag "changed" in the place where is 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’ve tried to do it this way:
var value = parseFloat($(this).text());
var ht = $(this).html().replace(value,$(this).attr("changed"));
$(this).html(ht);
But the problem is that the value of the div changes constantly based on a websocket, so when I change the value that way, the websocket stops updating the div for some reason.
The most I could was to put the value of interest inside the tag 'changed', now I need to take this value to div without touching the <i class="osg-outcome__trend">
.
Is there a way to do this in CSS? I think I would avoid these problems. Or a solution jQuery more precise?
Try to put the value 11.00 in some tag (span, p, div) and put an id or class there in the variable ht call for this id or class.
– LeAndrade