JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-lightness/jquery-ui.css">

<input type="image" src="/v/vspfiles/templates/100/images/buttons/btn_addtocart.gif" id="btnaddtocart" name="btnaddtocart" alt="Add to cart" border="0" onclick="return addToCart2(this.form, this);" />

<input type="hidden" name="ReplaceCartID" value="" />
<input type="hidden" name="ProductCode" value="M406789" />
<input type="hidden" name="e" value="" />

<input type="hidden" name="ReturnTo" value="ShoppingCart.asp" />

JavaScript

var theValue = $('input[name=ProductCode]').val();
alert(theValue);