+ 3

How to do something when the selects an option and then Submit it?

I know JavaScript and want to make a webpage that will contain a drop down list from which user selects an option and then clicks on submit button. A JavaScript function will be called accordingly with the user's selection. How do i make it?

29th Apr 2017, 6:43 AM
Aditya Kshitiz
Aditya Kshitiz - avatar
2 Respostas
+ 10
For the dropdown menu you can use <select>, the new HTML5 <datalist> or you can make a custom dropdown menu. The <datalist> and <select> tags need <option>Value</option> tags inside them for all the options you want. You don't need a separate submit button, you can just use onChange="function()" inside the <datalist> or <select> tag.
29th Apr 2017, 8:00 AM
ChessMaster
ChessMaster - avatar
+ 2
thanks for your answer
30th Apr 2017, 6:11 AM
Aditya Kshitiz
Aditya Kshitiz - avatar