在注册的页面如何用下来列表选取头像?

2010-5-16 杜世伟 JavaScript

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><form action="" method="post" name="myform">
<script language="javascript">
      //通过下拉列表选择头像时应用该函数
      function showlogo(){
      document.images.img.src=" images/head/"+document.myform.txt_ico.options[document.myform.txt_ico.selectedIndex].value;
      }
              </script>
     </td>
                    <td width="80"><img src=" images/head/0.gif" name="img" width="60" height="60"></td>
                    <td width="53" rowspan="2" align="center"><font color=red>*</font></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td> <select name="txt_ico" size="1" id="txt_ico" onChange="showlogo()">
                        <option value="0.gif" selected>头像1
                        <option value="1.gif">头像2</option>
                        <option value="2.gif">头像3</option>
                        <option value="3.gif">头像4</option>
                        <option value="4.gif">头像5</option>
                        <option value="5.gif">头像6</option>       </select>            

                  </td>
                  </tr>
                  </form>

Powered by emlog 沪ICP备2023034538号-1