var hit = $("#myid").find("a").attr("href").match(/^.+\((\d+)\)$/);
if (hit && hit.length == 2) {
     // hit[1] = "1234" in the example you provided
}
else {
     // didn't find the value
}


On Jan 2, 9:13 pm, "laredotorn...@zipmail.com"
<laredotorn...@zipmail.com> wrote:
> Hi,
>
> I am using JQuery 1.3.  I have this basic structure in my HTML ...
>
> <li id="myid">
> ...
> <a class="edit" href="javascript:edit(1234)"> ... </a>
> ...
> </li>
>
> How do I extract the "1234" from HTML assuming I know the id of the
> <li> element?
>
> Thanks, - Dave
>
> ps - I know its bad practice to have the javascript function in there,
> but sadly this is code I inherited and I can't change the href at this
> point.

Reply via email to