View buildHTML utility
This file contains 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
/* buildHtml - Helper method to construct html tags easily */ | |
var buildHtml = function(tag, attrs, innerHtml) { | |
var h = '<' + tag; | |
for (var attr in attrs) { | |
if(attrs[attr] === false) { | |
continue; | |
} | |
h += ' ' + attr + '="' + attrs[attr] + '"'; | |
} | |
return h += innerHtml ? '>' + innerHtml + '</' + tag + '>' : '/>'; |