+ 1
This is kind of a dumb question to ask, but can you take an html text and use it as a string in js
<div> <span> $100 </span> </div> Can I somehow get span through js, and remove the $ (dollars sign, or any other text)?
2 Respostas
+ 6
Yes,
let spn=document.querySelector('span');
spn.innerText=spn.innerText.replace('#x27;,'');
instead of calling it a dumb question you can add more description by editing .just for your own benifit. 👀
+ 3
🇮🇳Omkar🕉 Ok.
Thanks.
I said dumb, cuz I was thinking... “How is this even possible.. this is kind of dum*”.
—