<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>无刷新评论</title> <script src="js/jquery-1.11.3.js"></script> <script> $ ( Function () { $ ( " #btn_Add " ) .click ( function () { var STR = $ ( " #txt " ) .val (); // Get the text frame $ ( " UL " ). the append ( " <Li> " + STR + " </ Li> " ); // Add a new node list ul }); }) </ Script > </ head > <body > < ul > < li > fluorescent evil remains in the heart to ask regrettable </ li > < li > Huai Bi Ming sin ask regrettable that </ li > </ ul > < the INPUT of the type = "text" the above mentioned id = "TXT" /> < Button ID = "btn_Add" > Add </ Button > </ body > </ HTML >
Reproduced in: https: //www.cnblogs.com/xiemin-minmin/p/11021704.html