How to get text of var which has output HTML
I have a var 'webResultTotal' which stands for a number. This number is than outputted as HTML. I want to get this number and do some function with it. This is all I can come up with:

    var pageNumber = $("webResultTotal").text();

This doesn't work. However if I set: 

    var pageNumber = 50;

mythen my function works, so that means my script and function is okay. So how can I get the number 'webResultTotal' ? 
How to get text of var which has output HTML
===

I have a var 'webResultTotal' which stands for a number. This number is than outputted as HTML. I want to get this number and do some function with it. This is all I can come up with:

    var pageNumber = $("webResultTotal").text();

This doesn't work. However if I set: 

    var pageNumber = 50;

mythen my function works, so that means my script and function is okay. So how can I get the number 'webResultTotal' ? 