June 17th 2010
So the problem we face is that a string of content on a single line is hard to read. Something like that:
$(element).append('<div class="content"><div class="left"></div><div class="right"></div></div>');
It’s really not easy to maintain as you have to figure out where in the HTML structure you want to add new elements.
So here’s the tip
$(element).append(' \ <div class="content"> \ <div class="left"> \ </div> \ <div class="right"> \ </div> \ </div> \ ');
It’s a very nice way to keep the HTML structured to make sure the code is easily maintainable.
Hope you liked it 🙂