Last active
August 29, 2015 13:56
-
-
Save rockkhuya/8816013 to your computer and use it in GitHub Desktop.
Use push to write HTML code in Javascript
This file contains hidden or 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
var new_element = []; | |
new_element.push( | |
'<ul class="inline nested-fields" shp-role="dynamic_field_need_things" id="', num, '">', | |
'<li>', | |
'<input class="input-mini" id="', num, '" name="need_things" shp-role="dynamic_field_need_things" type="text" />', | |
'</li>\n', | |
'<li><a id="', num, '" shp-role="delete_field_need_things">×</a> </li>', | |
'</ul>' | |
); | |
new_element.join(''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment