JavaScript Onclik在锚点中更改文本并启用具有表单字段的div并隐藏onload默认属性

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JavaScript Onclik在锚点中更改文本并启用具有表单字段的div并隐藏onload默认属性相关的知识,希望对你有一定的参考价值。

<!--By Shashikanth reddy nalabolu - PHP Developer-->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">

function status1()
{
	
	if(document.getElementById("hchk").value=="0"){
	//alert("if");
	
	document.getElementById("r1").innerHTML="Basic";
		document.getElementById("hchk").value="1";
		var div1=document.getElementById("login1");
		div1.style.display="none";
		var div2=document.getElementById("new_acc");
		div2.style.display="block";
		
	}else{
		//alert("else");
		
		document.getElementById("r1").innerHTML="Advance";
		document.getElementById("hchk").value="0";
		var div2=document.getElementById("new_acc");
		div2.style.display="none";
		var div1=document.getElementById("login1");
		div1.style.display="block";
	}
		
}
function start_up()
{
		var div2=document.getElementById("new_acc");
		document.getElementById("hchk").value="0";
		div2.style.display="none";
}	
</script>
</head>

<body  onLoad="start_up()">
<table id="Table_01" width="464" height="431" border="0" cellpadding="0" cellspacing="0">

 <tr>
 	<td align="right" valign="top"></td>

    <td align="left" valign="top" background="images/centertabbgb.GIF">
	
	<table width="100%">
		<tr>
		  <td valign="top" align="right"><a href="#" name="r1" onClick="javascript:status1()" id="r1">Advance</a><br />
		  <input type="hidden" name="hchk" id="hchk" value="0" />
		     </td>
		  </tr>
		<tr>

		  <td valign="top">
		  
		  <form name="frmLogin" action="" method="post"  onSubmit="return validate_login()">
		  
		  <div id="login1">
		  <table width="100%"  border="0" cellspacing="1" cellpadding="1">
            <tr>
				<tD><font face="Verdana"><small>Login Form</small></font><br /><br /></tD>
			</tr>
			<tr>

              <td width="49%"><font face="Verdana"><small>Enter the E-mail Address </small></font></td>
              <td width="2%">:</td>
              <td width="49%"><input name="userid" type="text" id="userid"></td>
            </tr>
            <tr>
              <td><font face="Verdana"><small>Password </small></font></td>
              <td>:</td>

              <td><input name="password" type="password" id="password"></td>
            </tr>
			
            <tr align="center">
              <td colspan="3" valign="top">                              
                <input type="submit" name="Submit3" value="Submit" />
                 
                <input type="reset" name="Reset" value="Clear"/></td></tr>
            <tr align="center">

              <td colspan="3" valign="top"></td>
              </tr>
          </table>
		  </div>
		  </form>
		  
		  
		  </td>
		  </tr>
		
		<tr>
		<td valign="top">

		<form method="post" name="frmEnquiry" onsubmit="return Validate();">
		<input type="hidden" name="regis" value="1">
		<div id="new_acc">
		<table width="119%"  border="0" align="center" cellpadding="3" cellspacing="1">
              <tr bgcolor="#FEFBE0">
                <td width="46%" bgcolor="#FFFFFF"><font face="Verdana"><small>First Name</small></font></td>
         <td width="54%" bgcolor="#FFFFFF"><input id="text1" name="fbName" class="textbox" size="30"/></td>
       </tr>

       <tr align="left" valign="top">
         <td width="46%"><font face="Verdana"><small>Last Name</small></font></td>
         <td width="54%"><input id="text1" name="lbName" class="textbox" size="30"/>         </td>
       </tr>
	     <tr align="left" valign="top">
         <td><font face="verdana"><small> Email ID</small></font></td>
         <td><input id="text6" name="bEmail"
          class="textbox" size="30"/>         </td>

       </tr>
	    <tr align="left" valign="top">
         <td width="46%"><font face="Verdana"><small>Password</small></font></td>
         <td width="54%"><input name="pwd" type="password" class="textbox" id="text1" size="30"/>         </td>
       </tr>
	       <tr align="left" valign="top">
         
         </tr>


         <tr>
           <td> </td>
           <td><input name="Submit" type="submit"  value="Register" />
			  
			<input type="reset" name="Submit2" value="Cancel" /></td>
           </tr>
           
          </table>
		</div>
		 </form> 
		</td>

		</tr>
		</table>
      <p class="textblack"></td>
                            <td valign="top"> </td>
                          </tr>
                          <tr>
                            <td> </td>
                            <td> </td>
                            <td> </td>

                          </tr>
                      </table>
</body>
</html>

以上是关于JavaScript Onclik在锚点中更改文本并启用具有表单字段的div并隐藏onload默认属性的主要内容,如果未能解决你的问题,请参考以下文章

如何在锚文本后添加跨度?

使用 JavaScript/jQuery 将 URL 保存在锚标记中?

如何在锚点处渲染 EJS

:在锚点上悬停过渡

跨度在锚标记内阻止 iPhone 上 Safari 的点击事件

如何从 django 管理站点中删除更改密码链接?