Having problems using percentages passed in through ("input").val()
<p>To be honest, I think I just have to convert the values to integers, but I've tried a bunch of things and keep getting 'NaN' or something along the lines of 'cannot use this action on an object'.  I want to do things like use replace to remove the % or simply apply math to it.  I have tried String and parseInt() to try to convert but just get NaN.</p>

<p>This example gives me an alert box that says "10%" or "20%"...whatever the user types in</p>

<pre><code>thisInvoiceDiscount = $("#clientSearchInvoiceDiscountTextbox").val(); 
percentPresent = thisInvoiceDiscount.indexOf("%"); 
if (percentPresent == "-1") { 
} 
else { 
  alert (thisInvoiceDiscount);
  //I can't seem to do anything with thisInvoiceDiscount here
}
</code></pre>

<p>UPDATE: Using the 1st response:</p>

<pre><code>thisInvoiceDiscount = $("#clientSearchInvoiceDiscountTextbox").val();
var numberOnly = $("#clientSearchInvoiceDiscountTextbox").val().replace(/\D/g, '');
percentPresent = thisInvoiceDiscount.indexOf("%");
if (percentPresent == "-1") {
}
else {
    var integerValue =  parseInt(numberOnly, 10);
    alert (integerValue);
}
</code></pre>
