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+/, "$& "); });
Comments
Post a Comment