Site icon T4Tutorials.com

Hide input type textbox when user double click on paragraph – Jquery

Hide input type textbox when user double click on paragraph – Jquery

Lets begin with the program to Hide input type textbox in Jquery, when the user double click on the paragraph.

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("p").dblclick(function(){
    $("input").hide();
  });
});
</script>
</head>
<body>

<p>If you double-click on this paragraph, It will disappear.</p>
<p>If you double-click on this paragraph, It will disappear.</p>
<p>If you double-click on this paragraph, It will disappear.</p>
<input type="text" />
</body>
</html>

Ouput

Exit mobile version