Get value of select option immediately jquery

后端 未结 4 1586
暗喜
暗喜 2021-01-29 02:16

I have a simple dropdown and want to get the specific value of an option if the user changes the dropdown selection, but without having him to push a submit button. Is this poss

4条回答
  •  北海茫月
    2021-01-29 02:53

    Use the change event, which fires when the value of the element changes, like so:

    $('#BezirksAuswahl').change(function(e){
        alert(this.value);
    });
    

提交回复
热议问题