I have a DOM
like this
<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>
i just want to add span tag to all numbers like
<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 miles?</p>
</div>
I have tried so may ways and check this links too
Javascript/jquery get number value inside of element
How to get number inside a div with jquery
Jquery - Adding all numbers inside span of a particular class
but this can only select first numbers only i want to select all number inside the div , if the div contains 20 numbers i just need to add span all numbers , is this possible ? best answers must be appreciated ..