نسخة الكود كما يلي:
<! doctype html>
<html>
<head>
<title> </title>
<script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type = "text/javaScript"> </cript>
<type type = "text/css">
#divtips {
مرشح: ألفا (عتامة = 30) ؛
-الموز
التعتيم: 0.3 ؛/*آخر ، الشفافية 50 ٪*/
الموضع: المطلق ؛ العرض: 600 بكسل ؛
}
</style>
<script type = "text/javaScript">
$ (function () {
var $ txtNote = $ ("#txtNote") ؛
var $ divtips = $ ("#divtips") ؛
$ txtnote.focus (function () {
// الاختباء عند ضبط التركيز
$ divtips.hide () ؛
}). Blur (function () {
// عند المغادرة ، إذا كانت فارغة ، فسيتم عرضها ، وإلا فإنه سيتم إخفاؤه
$ divtips.toggle ($ txtnote.val () == "")
.CSS ({
"اليسار": $ txtnote.position (). اليسار ،
"TOP": $ txtnote.position (). TOP
}) ؛
}) ؛
$ divtips.click (function () {
$ txtnote.focus () ؛
}) ؛
$ txtnote.blur () ؛
}) ؛
</script>
</head>
<body>
لوحة الرسائل <br />
<textarea id = "txtnote"> </dextarea>
<div id = "divtips">
عزيزي ، مرحبًا بك في الزيارة.
(اترك اسمك في المربع أدناه ، يرجى ترك معلومات الاتصال الخاصة بك إذا كانت مريحة)
</viv> <br />
<type type = "text" value = "name" /> <input type = "text" value = "mobile /qq /..." />
</body>
</html>