KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Trying to get efficient here. How can I store an element as a variable before appending it to the DOM? Seems like it's a waste to create it, append it, then go find it again to make a variable. My method is below. OBV it's saving the string as a variable, not the object, but you get the idea. Any magic for me or do I have to make two trips? var $rGallery = '<section id="rGallery" />'; $bin.before($rGallery); console.log($rGallery);
Tags (comma-separated)
Save Edits
Cancel