JSFiddle - React, Tailwind, and code Playground

by yao3060

HTML

鼠标点击输入框:<input id="name" type="text" value="keywords"/>

JavaScript

$("#name").focus( function () {if($(this).val() == 'keywords') $(this).val("");});
$("#name").blur( function () {if($(this).val() == '') $(this).val("keywords");});