简体   繁体   中英

boxes do not appear on chrome

on my login page i have radio buttons for a new member and an existing member. if the user click the existing member's button - only then 2 input boxes appear : user name and pw. it works on IE but it does not work on chrome. This is the script. Can someone help ??

<script> 
    function dispLoing(val) 
    { 
        var obj=document.getElementById?document.getElementById("loginForm").style : document.all? document.all.loginForm : document.loginForm; 

        if (val=="new") 
        { 
            document.all.login(0).checked=true; 
            obj.display="none"; 
        } 
        if (val=="existing") 
        { 
            document.all.login(1).checked=true; 
            obj.display=""; 
        } 
    } 
</script> 


<td> 
   <div id="loginForm" style="position:relative;top:0px;left:0px;z-index:80;display:none;"> 
         <table border=0> 
            <tr> 
              <td><font style="font-size: 14px">Username:</font></td> 
               <td><input type="text" name="username" style="width: 100px; height:17px; font-size: 12px;"></td> 
             </tr> 
             <tr> 
             <td><font style="font-size: 14px">Password:</font></td> 
             <td><input type="password" name="pass" style="width: 100px; height:17px; font-size: 12px;"></td> 
            </tr> 
           </table> 

Don't use document.all , it doesn't work in all browsers. document.getElementById is standardized and works everywhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM