<select class="dd">
        <option>1</option>
        <option>2</option>
        <option>3</option>
    </select>
如上 一个 下拉列表 我需要 用js 或者  jq 给 上面的下拉列表一个  模拟选中的操作 该怎么去弄 ,
如 模拟当前选中了2 触发了某个函数等
注:是模拟选中操作  而不是 直接用   select.selected=true;或.value='1'
jsjavascriptjquery下拉列表select

解决方案 »

  1.   

    $('select').change(); document.getElementById('sleectid').change && document.getElementById('sleectid').change();  
      

  2.   

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type='text/javascript'>
    $(function(){
    $("select").change(function(){
    if($(this).find("option:selected").text()==2){
    b();
    }else if(
    $(this).find("option:selected").text()==2){
    c();
    }else{
    a();
    }
    function a(){
    alert("1 selected");
    }
    function b(){
    alert("2 selected");
    }
    function c(){
    alert("3 selected");
    }

    });
    })
    </script>
     <select class="dd">
        <option>1</option>
        <option>2</option>
        <option>3</option>
     </select>
      

  3.   

    change事件  完全不明白模拟选中  不是选中是什么意思啊
      

  4.   

    什么叫模拟选中?如果 select onchange 达不到你的要求。
    你可以自己用div 去模拟