Javascript examples for jQuery Method and Property:html
HTML block stored as var javascript
<html> <head> <script id="htmlTemplate" type="text/x-tmpl"> This <h1>is</h1> templated. </script> <script src="https://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript"> $(document).ready(//w w w .j a va 2 s.c o m function() { $('#2nd').html($('#htmlTemplate').text()); } ); </script> </head> <body> <div id="1st"> First div </div> <div id="2nd"> Second div </div> </body> </html>