JSFiddle - React, Tailwind, and code Playground
by gothic
HTML
<input type="text" id="address" value="请输入邮箱密码">
<input type="text" id="passwod" value="请输入邮箱密码">
<input type="button" value="登录">
JavaScript
$(function () {
$ ("#address").focus(function() {
var txt_value = $(this).val();
if(txt_value=="请输入邮箱地址") {
$(this).val("")
}
});
$("#address").blur(function() {
var txt_value = $(this).value ();
if(txt_value==""){
$(this).val("请输入邮箱地址")
}
});
})