我是一名网络开发学生,我需要一些帮助。我有下面的代码;只有在提交表单并且没有单击文本字段时,如何才能使其工作。我也希望它能够在.thanks Div中插入textField的值。请帮助我学习。电子邮件形式的交互性
<script type="text/javascript">
$(document).ready(function(){
$(".quote").click(function(){
$(this).fadeOut(5000);
$(".thanks").fadeIn(6000);
var name = $("#name").val();
$("input").val(text);
});
});
</script>
<style type="text/css">
<!--
.thanks {
display: none;
}
-->
</style>
</head>
<body>
<form action="" method="get" id="quote" class="quote">
<p>
<label>
<input type="text" name="name" id="name" />
</label>
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</p>
</form>
<div class="thanks"> $("#name").val(); Thanks for contacting us, we'll get back to you as soon as posible</div><!-- End thanks -->
现在的代码是存在的。 Dutchie感谢提醒我。 – 2011-03-30 20:53:03