Click the button to select the drop-down box

<input type="button" value="选择城市" id="btn16" />
        <select name="" id="ss">
            <option value ="1">武汉</option>
            <option value ="2" id="op1">北京</option>
            <option value ="3">上海</option>
        </select>
        <script>
            function my$(id){
                return document.getElementById(id);
            }
            my$("btn16").onclick=function(){
                my$("op1").selected=true;
            }
        </script>
        <textarea rows="30" cols="10" id="tt" readonly>
            ndofnsdfnosd
            ndfosnfosfij
            ndflsdfsjdf 
            ndfosfsnd 
            snfosdfos
         </ TextArea> 
        <INPUT type = "Button" value = "Sign" ID = "btn17" /> 
        <Script type = "text / JavaScript"> 
            My $ ( "btn17"). the onclick = function () { 
                $ My ( "TT") value = "lalallala";. // recommended value, because the form is a look into the label 
                // My $ ( "TT") the innerText = "lalallala";. 
            };
         </ Script>

 

Guess you like

Origin www.cnblogs.com/zhangDY/p/11424084.html