Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

I’ve a  Combobox-A, which is an HTML <select> with selected id and contents at the other place on onChange(). I want to pass the complete Combobox with its select id, and other parameters on fire of the onChange event?

 

How to pass parameters onchange of HTML select?

1 Answer

0 votes
by (19.7k points)

function create_comboA(your_Object) {

  var my_value = your_Object.my_value;  

  console.log(my_value);

}

<select id="create_comboA" onchange="create_comboA(this)">

  <option value="">Choose the combo</option>

  <option value="First Option">Apple</option>

  <option value="Second Option">Orange</option>

  <option value="Third Option">Banana</option>

</select>

No related questions found

1.2k questions

2.7k answers

501 comments

693 users

Browse Categories

...