javascript - separate first character from string -


i trying separate number first character of string rest of string. example 1options select should 1 options select.

please note select list dynamically generated

<select>     <option>1options select</option>     <option>2anything can here</option>     <option>3anything can here</option>     <option>5anything can here</option> </select>  $(".custom-ordered-list select option").each(function() {      //i think need loop through not sure next.                       }); 

i'd in following way:

$(".custom-ordered-list select option").text(function(i, text) {     return text.replace(/^\d+/, "$& "); }); 

demo: http://jsfiddle.net/63h7t/


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -