房天下 > 房天下问答 > 业主生活 > 其他
  • select标签如果在选择不同值的时候,页面的一些文字消失或者不消失

    <select id="select1" name="select1" onchange="tt(id)"><option value="">请选择</option><option value="1">opt1</option><option value="2">opt2</option><option value="3">opt3</option></select><script>function tt(id) { var aa = document.getElementById(id); alert(aa.value);}</script><p><font color="red">*</font>hello比如说这个程序,如果使当AA值为1的时候,红色的*不变,当选择是2的时候,红色的*消失

    提问者:鍾樂珊

    发布于2010-12-06

共1个回答
  • 江山好的很 丨Lv 0
    <select id="select1" name="select1" onchange="tt(id)"> <option value="">请选择</option> <option value="1">opt1</option> <option value="2">opt2</option> <option value="3">opt3</option> </select> <script> var tt= function(id) { var aa = document.getElementById(id); //alert(aa.value); if(aa.value=='2') document.getElementById('t').innerHTML="hello"; else document.getElementById('t').innerHTML='<font color="red">*</font>hello'; } </script> <p id="t"><font color="red">*</font>hello</p>
    +1 2010-12-07 举报
热门人气推荐
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。