How can I only allow shift+enter to return new line in text area? How can I only allow shift+enter to return new line in text area? jquery jquery

How can I only allow shift+enter to return new line in text area?


$("textarea").keydown(function(e){    // Enter was pressed without shift key    if (e.key == 'Enter' && !e.shiftKey)    {        // prevent default behavior        e.preventDefault();    }});

Try the jsFiddle.