如何在表单提交后显示Div并隐藏表单?香港专业教育学院试图jQuery的,但它没有奏效。帮我?这里是代码:如何在表单提交后显示Div并隐藏表单?我试过jquery,但它不起作用。帮我?
website body {
background-color: black; color: green; }#theirname { color:red; font-size: 6.0em; margin:auto; text-align:center; display:none; } #hellos { color:yellow; font-size:6.5em; margin-top:auto; text-align:left; display:none; } #thanks { color:yellow; font-size:4.3em; margin-right:20px; text-align:right; display:none; } #hello { border-style:groove; border-color: yellow; margin:auto; text-align:center; width:300px; } marquee { color:yellow; font-size:30px; } form { text-align:center; margin:auto; margin-top:120px; } </style> <script> function handler() { var div = document.getElementById('theirname'); var form = document.getElementById('fore'); div.innerHTML = document.getElementById('textbox').value; return false; } $(document).ready(function(){ $("#Fore").submit(function(e){ $("#fore").hide(slow); $("#hellos").show(3000); $("#theirname").show(3030); $("#thanks").show(4000); }); }); </script> </head> <body> <div id="hello">Welcome to here :D</div> <marquee behavior="scroll" scroll="left" bgcolor="red" onClick="">ill update this soon...</marquee> <div id="hellos">Hello,</div> <div id="theirname"></div> <div id="thanks">thank you for coming!</div> <form id="Fore" action="submit" method="post" onSubmit="return handler();"> Your name: <input id="textbox" type="text" name="fname" size="20" /> <input type="submit" value="post" /> </form> </body> </html>
这里是你可以看到我的意思。 jfiddle
+1为选取框... –
+50为选取框... – Kody
你什么意思? lol – Mrawesome4ever