How can i make html templates with jquery??

cbrune
cbrune used Ask the Experts™
on
How can i make html templates with jquery??
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I'm not sure I understand the question.  jQuery is used to manipulate the DOM in just about any way you want it.  To make a template, you would use from as few as one jQuery statement.  For a super simple example consider having only the following html:

<div id="content"></div>

Executing the following code

var html = ''
html += '<div id="example"><h2>This is a test</h2></div>';
$('#content').html(html);

you would end up with

<div id="content"><div id="example"><h2>This is a test</h2></div></div>

and you could make this as complex as you want.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial