0

I have a page with a lot of food items there are a few options for me to select for each food item. I want to sequentially select Order for everything on the menu. Is there a script to make this happen? Thanks!

<select class="form-control" onchange="setFlag(999$(this).val(),$('option:selected', this).html());">                                                                               </select>
    <option value="Order"> Make this order </option>
    <option value="Veto"> Veto this order </option>
user2999509
  • 97
  • 2
  • 4
  • 13

2 Answers2

2

HTML

<select id="sel">
<option value="Order"> Make this order </option>
<option value="Veto"> Veto this order </option>
  </select>

JS

document.querySelector("#sel").value = "Veto" // selects 2nd option from dropdown
Shivam Tiwari
  • 345
  • 3
  • 11
0

I would take a look at this answer https://stackoverflow.com/a/6068322/1115876

something like

$('[value="Order"]').prop('selected', true)

should work

QuinnFreedman
  • 2,242
  • 2
  • 25
  • 42