我已经创建了两个三个div,我希望当我点击该选项卡上,其余的两个div应该隐藏,第三应显示。而我我试图做到这一点,但直到现在我还没有取得任何成功。隐藏其余的div和显示一个新的div后点击锚标记
请帮助我解决这个问题。
三个div的都是这样的---
第一个div
<div id="div1">
<div style="text-align:center;padding:10px;">New to Register?</div>
<table align="center">
<tr>
<td><input type="email" name="email" placeholder="Email" required pattern="[a-z0-9._%+-][email protected][a-z0-9.-]+\.[a-z]{2,3}$" title="[email protected]" >
</td>
</tr>
<tr>
<td><input type="password" name="password" placeholder="Password" required></td>
</tr>
<tr>
<td><input type="password" name="password" placeholder="Confirm Password" required></td>
</tr>
<tr>
<td>
<button style="height:32px; border-radius:2px; border:none; color:white; width:100%; margin-bottom: 12px; background-color:rgb(255, 201, 73)" name="submit" id="submit"> LOG IN </button>
</td>
</tr>
</table>
</div>
第二个div ---
<div id="div2">
<div style="text-align:center;padding:10px;">Log In</div>
<table align="center">
<tr>
<td><input type="text" name="email" placeholder="Email" required pattern="[a-z0-9._%+-][email protected][a-z0-9.-]+\.[a-z]{2,3}$" title="[email protected]" ></td>
</tr>
<tr>
<td><input type="password" name="password" placeholder="Password" required></td>
</tr>
<tr>
<td colspan="2" align="center">
<div class="left">
<label><input class="classforcheckbox" type="checkbox" /> Keep me logged in</label>
</div>
<div class="right" ><a>Forgot Password?</a></div>
</td>
</tr>
<tr>
<td>
<button style="height:32px; border-radius:2px;margin-bottom: 10px; border:none; color:white; width:100%; background-color:rgb(255, 201, 73);" name="submit" id="submit"> LOG IN </button>
</td>
</tr>
</table>
</div>
三格---
<div id="div3">
<div style="text-align: center;padding: 10px">Forgot Password</div>
<div style="text-align: center;padding: 10px">Enter your email below and we'll send you an email with instruction on how to re-new your password.</div>
<table align="center">
<tr>
<td>
<input type="text" name="email" placeholder="Email" required pattern="[a-z0-9._%+-][email protected][a-z0-9.-]+\.[a-z]{2,3}$" title="[email protected]">
</td>
</tr>
<tr>
<td>
<button style="height: 32px;border-radius: 2px;margin-bottom: 10px;border: none;color: white;width: 100%;background-color: rgb(255, 201, 73);" name="submit" id="submit">Send Email</button>
</td>
</tr>
</table>
</div>
我当我cli时应该隐藏div1,div2 ck忘记密码,然后div3应显示。 任何帮助将不胜感激。
要隐藏DIV1和DIV2整个DIV3的的onclick? –