JQuery input value removing/clearing on page ready - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

JQuery input value removing/clearing on page ready

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>&lt;input type="search"&gt;</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.js"></script> 
   </head> 
   <body> 
      <input type="search" id="myId" value="Text Value"> 
      <script type="text/javascript">
$(document).ready(function() {
  console.log($("input[type=search]").val(""));
});//ww  w .  ja  va 2  s  .c o  m

      </script>  
   </body>
</html>

Related Tutorials