Prevent carriage returns

Prevent carriage returns

I have a vanilla js function below  that prevents any line breaks in a textarea whats the jquery equivalent of this please, covering all bases if users is typing or pasting content.:

 window.onload = function(){
     var short_desc = document.getElementById("short_desc");
       short_desc.oninput = function() {
         document.myForm.short_desc.value = document.myForm.short_desc.value.replace(/\n/g, " ").replace(/ +/g," ");
     }
     };