parseInt(string)和Number(string)JavaScript有什么区别?
我有一个DOM这样的
<div class="main_div">
<p>A car averages 27 miles per gallon. If gas costs $4.04 per gallon, which of the following is closest to how much the gas would cost for this car to travel 2,727 typical miles?</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我只想为所有数字添加 span 标签,例如
<div class="main_div">
<p>A car averages <span> 27 </span> miles per gallon. If gas costs $<span>4.04</span> per gallon, which of the following is closest to how much the gas would cost for this car to travel <span>2,727</span> typical …Run Code Online (Sandbox Code Playgroud)