我正在为一个网站创建一个注册页面,并在一个下拉框中进行编码,告诉用户我们为什么需要生日。出于某种原因,我的代码无法正常工作。
这是代码:
<script language="javascript" type="text/javascript">
function toggleSlideBox(x) {
if ($('#'+x).is(":hidden")) {
$('#'+x).slideDown(300);
} else {
$('#'+x).slideUp(300);
}
}
</script>
这是HTML代码:
<a href="#" class="mouseover" onclick="return false" onmousedown="javascript:toggleSlideBox('why');">why?</a>
<div id="why" style="background-color:#E6F5FF; border:#999 1px solid; padding:12px; display:none; margin-top:8px;"> Sometime down the road we may offer content that is only suitable for people over 18. We require this information to check your age. <br />
<br />
We can also use this information to alert your friends to when your birthday is. </div>