Bind click event on select option

前端 未结 7 1275
长情又很酷
长情又很酷 2021-01-17 21:54

I\'ve got a problem making a click event on an HTML option element work.

Even a simple console.log(\'hello!\'); won\'t work.

7条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 22:07

    Check this js fiddle --

    http://jsfiddle.net/4W826/

    HTML

      
    

    JQUERY

    $('#mySelect').bind('click', function(){
    alert('hi!');
    });
    

    Change from Click to Change

提交回复
热议问题