嗨,我正在尝试隐藏表单并在单击发送按钮时显示一条消息。我已经尝试了很多事情它在 document.ready 函数中,但这似乎导致的错误比它修复的要多。这就是代码目前的样子;
<form class="contact">
<p class="contact-name">
<label class="contact-author">Name*</label>
<input class="input-name" type="text" name="name" placeholder="Your name"><br>
</p>
<p class="contact-email">
<label class="contact-author">Email*</label>
<input class="input-email" type="email" name="email" placeholder="Email Address"><br>
</p>
<p class="contact-msg">
<label class="contact-author">Message*</label>
<textarea class="input-msg" type="text" name="comments" maxlength="1000" placeholder="Enter your message"></textarea><br>
</p>
<p class="contact-send">
<input class="input-send" id="send" type="submit" value="Send" name="submit">
</p>
</form>
<div id="send-msg" style="visibility:hidden;">
<p>Thanks your message has been sent!</p>
</div>
$('#send').click(function() {
$('.contact').hide();
$('#send-msg').show();
)};
JSFiddle - http://jsfiddle.net/rvfhu/