Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread Karl Swedberg
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 _

Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread tony stamp
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

Re: [jQuery] how to get value between brackets in a string

2009-12-14 Thread Leonardo K
$('#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

[jQuery] how to get value between brackets in a string

2009-12-14 Thread tony stamp
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