Answers for "select id send value"

0

select id send value

<select name="product" id="pID" class="form-control">
              <option value=""> -- Select Product --</option>
              @foreach ($products as $product)
                  <option value="{{ $product->name }}" data-price={{$product->price}}>{{ $product->name }}</option>
              @endforeach 
            </select>
            
var unit_price = $('#pID option[value="'+pID+'"]').data('price');
Posted by: Guest on October-05-2021

Browse Popular Code Answers by Language