提交换行和空格的一段代码

<script type="text/javascript">
$(function(){
$("#myform").submit(function(){
text = $("#menu").val();
text = text.replace(/\r/g," ");
text = text.replace(/\n/g,"\n");
$("#menu").val(text);
//alert($("#menu").text());
});

});
</script>

  

posted @ 2018-10-24 16:36  充实地生活着  阅读(258)  评论(0)    收藏  举报