Well I have the following code:
var tempo = "Rolling in 8.31...";
What I want is the string above, leave only the number 8, so that the var time, is as follows:
var tempo = "8";
How can I do this?
Thank you.
@EDIT:
Current Code:
setInterval(function(){
var tempo = document.getElementById("banner");
var match = tempo.match(/[^\d](\d+)/);
var nr = match && match[1];
console.log(nr);
}, 1000);