您好我正在尝试隐藏表单,并在单击发送按钮时显示消息。我已经尝试了很多东西它在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/
答案 0 :(得分:2)
一些事情:
)}
实际应为})
display: none;
更新了小提琴:http://jsfiddle.net/rvfhu/6/