自动发布信息。
但是有些网页value是隐藏的
document.getElementById("id").options[0].selected=true;这个脚本实现不了。。郁闷- -

解决方案 »

  1.   


    $("#typeid").val( "xxxxx" ); // no.1// no.2
    window.setTimeout( function(){
        $("#typeid").val( "0" );
    } , 10 );实际项目中  建议使用no.2
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script type="text/javascript">
    window.onload=function(){
    var se=document.getElementById('typeid');
    se.selectedIndex=0;
    window.setTimeout(function(){
    alert(se.value)
    },1000);
    }
    </script>
    </head><body>
    <select name="typeid" id="typeid" width="80" selecti="0" style="display: none;">
    <option value="0"></option>
    </select>
    <a href="javascript:;" id="typeid_ctrl" style="width:80px" tabindex="1" initialized="true">选择主题分类</a>
    </body>
    </html>
    不明白你的意思  
      

  3.   


    function selectIt(id, index) {
        var selectNode = document.getElementById(id);
        var selected = selectNode.selectedIndex;
        selectNode.options[selected].removeAttribute('selected'); 
        selectNode.selectedIndex = index;
        selectNode.options[index].setAttribute('selected', 'selected');
    }