Stop people from writing in text input boxes : blur « jQuery « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("input").focus(function () {
                  $(this).blur();

            });
        });
    </script>
  </head>
  <body>
    <body>
     <p><input type="text" /> <span>focus event fire</span></p>
    </body>
</html>








30.21.blur
30.21.1.Stop people from writing in text input boxes
30.21.2.To triggers the blur event on all paragraphs:
30.21.3.blur(fn): blur event fires when an element loses focus