Search code examples
jqueryhtml-content-extractionsiebel

extract an id from a tag using jquery


I have an automatically generated A tag in Siebel application like given below

<a href='JavaScript:SWESubmitForm(document.SWEForm2_0,s_5,"s_2_2_16_0","1-DOOYAL")'  tabindex=2997  id='s_2_2_16_0_efl''>

I need to extract the following value "1-DOOYAL" from this tag. I am not able to construct the jquery expression to do the same.

Can anybody please help??


Solution

  • This should do the trick:

    var split = $(this).prop('href').split('","');
    
    return split[split.length - 1].substr(-2);