I am trying to wrap a span around all numbers in a div so I can style them accordingly.
It will be for Bible verses that will be copied and pasted into a textarea. I would like to style all of the numbers within that. Similar to how this site does here: http://marshill.com/media/trial/trial-and-jesus#scripture
Under the "Scripture" tab.
elem.innerHTML = elem.innerHTML.replace( /\b(\d+)\b/g, '<span>$1</span>' );
Live demo: http://jsfiddle.net/ujA86/
©2020 All rights reserved.