JSFiddle - React, Tailwind, and code Playground
by Spokey
HTML
<select id="product-select">
<option></option>
<option>Black</option>
<option>Lime</option>
<option>Navy</option>
<option>Blue</option>
</select>
<select id="product-select2">
<option></option>
<option>Black</option>
<option>Lime</option>
<option>Navy</option>
<option>Blue</option>
</select>
<!--I have multiple section forms each with different ID.. // I want to print on page 60$, but when user selects any of the 2 option forms the price will get +5$ for each. -->Total price <span>60</span>$
JavaScript
$('select').change(function () {
var s = 60;
$('select').each(function () {
if ($(this).val().length) {
s = s + 5
}
});
$('span').text(s);
});