0

Here is my code. I tried this in firefox as well as chrome but it us not working

Html:

  <form id="leform">
    <div>
        Name: <input type="text" name="firstname">
        <textarea type="text" name="lastname"></textarea>
    </div>
    <input type="submit">
</form>

Script:

 $(document).ready(function() {

    $(document).keypress(function(e) {

        if (e.which == 13 && e.target.tagName != "TEXTAREA") {
            return false;
        }
    });
});
Andrew
  • 5,290
  • 1
  • 19
  • 22
Raj
  • 165
  • 1
  • 2
  • 11

0 Answers0