1.js判断texteare中内容为空或空格
<textarea name="note" id="note" cols="30" rows="10"></textarea>
<script>
note = $("textarea[name='note']").val() ; //去掉所有空格后再判断是否为空
if (note.replace(/(^\s*)|(\s*$)/g, "")=="")
alert("内容为空");}
</script>
1.js判断texteare中内容为空或空格
<textarea name="note" id="note" cols="30" rows="10"></textarea>
<script>
note = $("textarea[name='note']").val() ; //去掉所有空格后再判断是否为空
if (note.replace(/(^\s*)|(\s*$)/g, "")=="")
alert("内容为空");}
</script>