+ 4
Can you have text show up after input (HTML)
Is there any way to have code(text) show up after you submit an input in HTML using HTML5 or javascript? For example, if you wanted "Thanks for submitting!" after you submitted an input, how would you?
4 Answers
+ 10
yeah you can. you can learn about it in Javascript & php .
copy paste this code to see :
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form>
<input type="text" placeholder="text" id="input"
autofocus required/>
<button type="button" id="sub" onclick="go()"">
submit
</button>
</form>
<p id="p"></p>
<!--javascript-->
<script>
function go(){
var output= document.getElementById("p");
output.innerHTML= "thank you for submission !"
}
</script>
</body>
</html>
+ 7
becuse help you this code with jquery đ
<input type="text" id="txt">
<p></p>
<input type="submit" id="btn">
<!--j query-->
<script>
$("#btn").click (function(){
var txt=$("txt").val ();
$("p").html=txt;
});
</script>
+ 7
Tyler you're welcome.
+ 4
Thanks!