Get selected value in datalist using jQuery

后端 未结 9 1900
终归单人心
终归单人心 2020-12-06 11:46

Very simple and straight forward. I pre-populated a HTML datalist with values, on the form when I want select a value and insert it into SQLite database. This is my example

9条回答
  •  猫巷女王i
    2020-12-06 12:01

    You simply give your input an ID and then use the input's val() like so:

    HTML:

    
    

    JS:

    $('#typeInput').val();
    

提交回复
热议问题