我是一名網絡開發學生,我需要一些幫助。我有下面的代碼;只有在提交表單並且沒有單擊文本字段時,如何才能使其工作。我也希望它能夠在.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