show/hide submit button on focus/relase input textbox

when focus an input textbox auto show submit button, on release focus textbox auto hide submit button

Use Ask Question 
Need HTML, CSS, script code for, when focusing on input textbox auto show submit button and release focus textbox auto-hide submit button.
Please give an example of HTML code.

Asked Question by Nikhil, Hyd

When Focus one of the textboxes, then auto show one submit button and release focus textbox, then auto-hide submit button.
In this we use HTML, CSS  and javascript code requires.
See following example, suit your requirement.



<html>
<body>

Enter a value <input type="text" onfocus="myFunction()" onblur="myFunction1()">

<input id="ss" type="submit" value="submit" style="display:none;">

<script>
function myFunction() {
  document.getElementById("ss").style.display = "block";
}
</script>
<script>
function myFunction1() {
  document.getElementById("ss").style.display = "none";
}
</script>

</body>
</html>

Output see below
Enter a value

0 Comments:

Post a Comment