Last active
December 27, 2015 08:59
-
-
Save EragonJ/7300164 to your computer and use it in GitHub Desktop.
Template 1 with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
// you can cache this $tmpl for later use | |
var $tmpl = $("#tmpl").remove().clone(); | |
$tmpl.find(".header").text("This is header"); | |
$tmpl.find(".content").text("This is Content"); | |
$tmpl.removeClass("hide"); | |
$(".target").append($tmpl); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div id="tmpl"> | |
<h1 class="header"></h1> | |
<p class="content"></p> | |
</div> | |
<div class="target"></div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hide { | |
display: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment