I have a string in JavaScript like #box2 and I just want the 2 from it.
#box2
2
I tried:
var thestring = $(this).attr(\'href\'); var
You should try the following:
var txt = "#div-name-1234-characteristic:561613213213"; var numb = txt.match(/\d/g); numb = numb.join(""); alert (numb);
result
1234561613213213