1. 程式人生 > >select選中的值改變另一個input的值

select選中的值改變另一個input的值

element htm company change rip style clas pan select

HTML:

<select id="hhh" onchange="aa()"><option value="11">1</option><option value="22">2</option><option value="33">3</option></select>
<input class="company" id=‘account‘ >

JavaScript:

<script type="text/javascript">

        function aa(){
            document.getElementById(
‘account‘).value=document.getElementById(‘hhh‘).value; } </script>

select選中的值改變另一個input的值