กรณีการใช้งานอย่างง่ายของฟังก์ชั่นข้อความ JS (แนะนำ)
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-ype" content = "html; charset = utf-8"/> <title> แพ็คเกจ jQuery </head> <body> <div id = "nr"> </div> <div> เนื้อหา: <textarea id = "txt"> </textarea> <br/> <อินพุตประเภท = "ปุ่ม" value = "ส่ง" id = "btn"/> </div> </body> id = btn และเพิ่มเหตุการณ์คลิก $ ("#btn") คลิก (ฟังก์ชั่น () {// ก่อนค้นหาค่าในฟิลด์ข้อความ var nt = $ ("#txt") val (); // ดึงค่าที่ป้อนโดยผู้ใช้ในฟิลด์ข้อความ (nt+"<br>") ลงใน DIV ด้วย ID TOP และ GO $ ("#NR"). ผนวก (STR);ข้างต้นเป็นกรณีการใช้งานอย่างง่าย (แนะนำ) ของฟังก์ชั่นข้อความ JS ที่นำมาให้คุณโดยบรรณาธิการ ฉันหวังว่าทุกคนจะสนับสนุน wulin.com เพิ่มเติม ~