I\'ve seen a lot of different styles (and few different methods) of creating elements in jQuery. I was curious about the clearest way to build them, and als
Templates are great and if you have access to them in your project, I suggest you use them. If you're using Underscore or Lodash it's built in. In some cases however, you will need to build HTML in your code whether it's refactoring or testing. I've found that the below format is the clearest to read when that is the requirement.
Note: The HTML spec allows single OR double quotes for attributes in your markup so don't bother with all the crazy escaping.
this.$fixture = $([
"",
" ",
" ",
""
].join("\n"));