Sunday, August 30, 2009

[jQuery] Re: Dissect an ID

I'd math the regex "\d+$", i.e., I'd get numbers at the end of the value.

Then you could operate on the matched value.

--
Jorge Godoy     <jgodoy@gmail.com>


On Sun, Aug 30, 2009 at 19:29, Phil <pjwhitehead93@googlemail.com> wrote:

In jQuery how do I remove a certain part of an id...

for example i have a div id='thisisadiv_1'
I want to remove the 'thisisadiv_' part
This is so I can add/subtract 1 to switch divs.

Thanks in Advance.
Phil.

No comments: