How to update HTML text via javascript without distrubing css
i been using certain properties like innerText to update HTML text but for some reason CSS (font color, size etc) is not applying on those text. How to fix it?
6 Replies
Put it in a codepen; works fine for me.
im getting data from API will that cause and issue? font size is 0.75rem , after updating its 1rem
Get rid of
sup
and the span
surrounding both paragraphs. <span>
is a generic container to wrap inline text
Replace <span>
with a p
tag and it works
ok
it worked thanks