Disable New Line in Textarea when Pressed ENTER

后端 未结 4 1066
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 18:06

I am calling a function whenever someone press enter in the textarea. Now I want to disable new line or break when ent

4条回答
  •  星月不相逢
    2020-12-01 18:39

        $(".Post_Description_Text").keypress(function(event) {
    
          if (event.which == 13) {        
    
            alert("Function is Called on Enter");
    
              event.preventDefault(); //Add this line to your code
    
           }
    
       });
    

提交回复
热议问题