to elaborate a bit, you could store the result of that line in a
variable and then use it.
I'd do the replace a bit differently.
var n = $('#pageCount').text().replace(/[)(]/g,'');
or use .match instead:
var n = $('#pageCount').text().match(/\d+/)[0]
Now you can do something with n.
--Karl
_
thanks, but out of interest, how do i just get the number value?
Leonardo K wrote:
>
> $('#pageCount').text().replace(')','').replace('(','')
>
> On Mon, Dec 14, 2009 at 10:41, tony stamp wrote:
>
>>
>> I have a simple span element with the id of pageCount, which has a value
>> of
>> "(5)", f
$('#pageCount').text().replace(')','').replace('(','')
On Mon, Dec 14, 2009 at 10:41, tony stamp wrote:
>
> I have a simple span element with the id of pageCount, which has a value of
> "(5)", for example. I am attempting to get the just number value without
> the
> brackets, or some way of adju
I have a simple span element with the id of pageCount, which has a value of
"(5)", for example. I am attempting to get the just number value without the
brackets, or some way of adjusting the number and leaving the brackets. Any
pointers?
--
View this message in context:
http://old.nabble.com/ho
4 matches
Mail list logo