参考文章:https://blog.csdn.net/daiqinge/article/details/52799811
$(
function() {
var
placeholder =
'line1 \n \n line2';
$(
'textarea').
val(
placeholder);
$(
'textarea').
focus(
function() {
if (
$(
this).
val() ==
placeholder) {
$(
this).
val(
'');
}
});
$(
'textarea').
blur(
function() {
if (
$(
this).
val() ==
'') {
$(
this).
val(
placeholder);
}
});