String concatenation with array join


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var el = ['<li id = "services_item' + service_id + '">',
  2. '<span class="left">Title</span>',
  3. '<span class="right"><a href="#" onclick="remove();">Remove</a></span></li>'].join("\n");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.