I have a template string that I need to turn into a jQuery object so I can parse it and fill out the data.
$(function(){
var template = '<h3>Details</h3>' +
'<ul>' +
'<li>Submitted: <span class="submittedTime"></span></li>' +
'<li>Submitted by: <span class="submitter"></span></li>' +
'<li>Contact Information' +
'<ul>' +
'<li>Name: <span class="contactName"></span></li>' +
'<li>Name: <span class="contactEmail"></span></li>' +
'</ul>' +
'</li>';
var t = $(template);
});
When I try to perform a jQuery operation on them (such as .find()
), it fails.
Do you have any ideas on what I'm doing wrong?