在选择默认值时,我如何仍然允许我的更改事件发生下拉?
<select id='statsGraphingSelect'> <option value='1' selected="selected">1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> </select> $("#statsGraphingSelect").change(function() { if ($("#statsGraphingSelect option[value='1']").attr('selected')) {//something happens here } if ($("#statsGraphingSelect option[value='2']").attr('selected')) {//something happens here } if ($("#statsGraphingSelect option[value='3']").attr('selected')) {//something happens here } if ($("#statsGraphingSelect option[value='4']").attr('selected')) {//something happens here } }