1var id_of_div = "div_id_12";
2var id_number = parseInt(id_of_div.replace(/[^0-9.]/g, ""));
3console.log(id_number);//12
1
2// Html: <span id="foo">280ms</span>
3
4var text = $('#foo').text();
5var number = parseInt(text, 10);
6alert(number);
7
8// parseInt('ms120'.replace(/[^0-9\.]/g, ''), 10);
1You can get it like this:
2
3var suffix = 'comment_like_123456'.match(/\d+/); // 123456
4
5With respect to button:
6
7$('.comment_like').click(function(){
8 var suffix = this.id.match(/\d+/); // 123456
9});
10
11It works for me.