Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get number from string using jquery

You can get it like this:

var suffix = 'comment_like_123456'.match(/d+/); // 123456

With respect to button:

$('.comment_like').click(function(){
  var suffix = this.id.match(/d+/); // 123456
});

It works for me.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #number #string #jquery
ADD COMMENT
Topic
Name
1+1 =