我想在此网站上创建一个标题文本框。当用户没有发生任何事情时,当用户键入文本框时,所有内容都将被删除。
答案 0 :(得分:0)
假设您正在使用html + javascript / jquery
请检查:Create an ASP.NET TextBox Watermark Effect using jQuery
或
使用jquery的示例脚本
$().ready(function() {
swapValues = [];
$(".wm").each(function(i) {
swapValues[i] = $(this).val();
$(this).focus(function() {
if ($(this).val() == swapValues[i]) {