Quick Tip: Create a Makeshift JavaScript Templating Solution


Sometimes, you don't require a high-quality templating solution, but still need to keep from mixing lots of nasty HTML into your JavaScript. In these cases, a simple, makeshift templating system can go a long way.

Choose 720p for the best clarity.
Subscribe to our YouTube channel for more training.

Final Source




The method outlined in the screencast is the most readable, however, if you'd prefer a more automated approach, we can apply the values and regular expressions dynamically, like so:

This is the method that I'm most likely to use.

Additional Tools

If you'd prefer a more flexible solution, any of the following should do the trick!