هناك العديد من الطرق للحصول على معلومات النص. في هذا المثال ، نستخدم طريقة النص لـ jQuery. أعتقد أن كل شخص استخدم هذه الطريقة ، إنها بسيطة وعملية. بعد الحصول على تنبيه واستخدامه لإطفاء النص ، ما يلي هو رمز التنفيذ
<! doctype html> <html> <head> <meta http-equiv = "content-type" content = "text /html ؛ charset = utf-8" /> <style> p {margin: 8px ؛ حجم الخط: 20 بكسل ؛ اللون: الأزرق. المؤشر: مؤشر. } b {text-decoration: thundline ؛ } زر {المؤشر: مؤشر ؛ } </style> <script type = "text/javaScript" src = "js/jquery -1.9.1.min.js"> </script> </head> <body> <b> أظهر النص الخاص بي </b> <div id = "text"> </viv> <script> $ ("#النص"). النص = $ (this) .text () ؛ </script> </body> </html>