I am trying to input an exchange rate into a text field and update multiple text areas with new rates.
Exchange Rate <input type="text" value="" id="exchange_rate">
<input type="button" value="Update Price" id="update_price">
The number of text areas may vary, here are some samples:
<input class="price" name="pro_name[88197][1]" rel="4450000" value="" type="text">
<input class="price" name="pro_name[12316][2]" rel="4451000" value="" type="text">
<input class="price" name="pro_name[46511][3]" rel="4575120" value="" type="text">
<input class="price" name="pro_name[45151][4]" rel="2343400" value="" type="text">
<input class="price" name="pro_name[165652][5]" rel="4534500" value="" type="text">
<input class="price" name="pro_name[85559][6]" rel="4450000" value="" type="text">
Now I want to calculate the value for each text area by multiplying the 'rel' (Japan YEN amount) with the exchange rate (USD).
I have started my jQuery code as shown below but I am facing some issues. Can someone please help me solve this problem?
$("#update_price").click(function () {
var all_price_element = [];
price_class = $( ".price" ).toArray();
for (var i = 0; i < price_class.length; i++) {
all_price_element.push(price_class[i].innerHTML);
}
});