Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery extract number from string

var id_of_div = "div_id_12";
var id_number = parseInt(id_of_div.replace(/[^0-9.]/g, ""));
console.log(id_number);//12
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #extract #number #string
ADD COMMENT
Topic
Name
2+2 =