Javascript examples for jQuery Method and Property:append
Jquery append() on another line
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(window).load(function(){//from ww w. j a v a2 s. c om var content = {}; content.time = "time"; content.message = "message"; $("p").append($("<span/>", { class: "time", text: content.time })).append($("<br />")).append($("<span/>", { class: "content", text: content.message })); }); </script> </head> <body> <p></p> </body> </html>