Q:

How can i multiply select option data attributes with input text area values?

How can i multiply select option data attributes with input text area values?
<select>
    <option value="0" disabled selected>Select</option>
    <option date-price="2" value="1">Sausage</option>
    <option date-price="4" value="2">Potato</option>
    <option date-price="6" value="2">Pickle</option>
</select> 
<input name="quantity">
<div id="total">??</div>

A:

Using the price as value field, you should try something like that:
let price = document.getElementsByTagName('select')[0].value;
let quantity = document.getElementsByName('quantity')[0].value;
let total = price * quantity;

document.getElementById('total').innerHtml = total;

If you don't want to change the value of the option element;
let select = document.getElementsByTagName('select')[0];
let price = select.options[select.selectedIndex].dataset.price;
let quantity = document.getElementsByName('quantity')[0].value;
let total = price * quantity;

document.getElementById('total').innerHtml = total;

The last solution allows you to get the data attribute "price" from the currently selected option.

