我在 jQuery 中使用.show
and时遇到问题。.hide
基本上,一旦您按下注册按钮,我希望出现两个选项,这是代码:
HTML
<div id='register'>
<form>
<input type='button' class='register-button' name='register-button' value='R e g i s t e r !'>
</form>
<form id='register-type'>
<span class='register-type-background'> </span>
<input type='button' class='register-type-band' name='register-type-band' value='Band'>
<input type='button' class='register-type-user' name='register-type-user' value='User'>
</form>
</div>
查询:
$(document).ready(function(){
$('#register-type').hide();
$('.register-button').click(function(){
$('#register-type').show();
});
});
还有更多 HTML:
<head>
<title> Title </title>
<link rel='stylesheet' href='stylesheet.css' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script>
<script type='script' src='javascript.js'> </script>
</head>