need to extract certain values from attribute and place them in variables

Posted by user357034 on Stack Overflow See other posts from Stack Overflow or by user357034
Published on 2010-06-10T14:54:50Z Indexed on 2010/06/10 15:22 UTC
Read the original article Hit count: 204

Filed under:
|

In the following markup on a page I want to extract out the following and put them in seperate variables.

1- In the onclick attribute get the value after the "ProductID" and put it in its own variable. "ProductID" So in this case it would be 318

2- In the onclick attribute get the value after the "Orig_price" and put it in a variable, "Orig_Price" So in this case it would be 22.95

3- In the onclick attribute get the value after the "width" and put it in a variable, "width" So in this case it would be 330

4- In the onclick attribute get the value after the "height" and put it in a variable, "height" So in this case it would be 300

<a href="javascript:void(0);" onclick="window.open('/BulkDiscounts.asp?ProductID=318&ProductCode=' + escape('LB30X40ES') + '&Orig_Price=22.95', 'Discounts', 'scrollbars,status,resizable,width=330,height=300');"><img src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery