I have an element in javascript like follows:

```
var count1 = '<span data-modelName="count[0]"> 3 </span>';
var count2 = '<span data-modelName="count">3</span>';

```

I want to extract 3 from the span element. How can i do it? The content within span element will be any number of digits.