Get current value selected in dropdown using jQuery

前端 未结 11 1851
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 11:59

I have a set of dynamically generated dropdown boxes on my page. basically I clone them using jQuery. now I want to capture the value selected on each dropdown on change eve

11条回答
  •  时光说笑
    2020-12-13 12:55

    Check it Out-->

    For getting text

    $("#selme").change(function(){
     $(this[this.selectedIndex]).text();
    });
    

    For getting value

    $("#selme").change(function(){
     $(this[this.selectedIndex]).val();
    });
    

提交回复
热议问题