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
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Dec 14, 2009, at 7:48 AM, Leonardo K wrote:
$('#pageCount').text().replace(')','').replace('(','')
On Mon, Dec 14, 2009 at 10:41, tony stamp <tonyst...@hotmail.co.uk>
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 adjusting the number and leaving the
brackets. Any
pointers?
--
View this message in context:
http://old.nabble.com/how-to-get-value-between-brackets-in-a-string-tp26777141s27240p26777141.html
Sent from the jQuery General Discussion mailing list archive at
Nabble.com.