function htmlElementAsString(elem) {
	    var out = [],
	        className,
	        classes,
	        key,
	        attr,
	        i;

	    if (!elem || !elem.tagName) {
	        return '';
	    }

	    out.push(elem.tagName.toLowerCase());
	    if (elem.id) {
	        out.push('#' + elem.id);
	    }

	    className = elem.className;
	    if (className && isString(className)) {
	        classes = className.split(' ');
	        for (i = 0; i < classes.length; i++) {
	            out.push('.' + classes[i]);
	        }
	    }
	    var attrWhitelist = ['type', 'name', 'title', 'alt'];
	    for (i = 0; i < attrWhitelist.length; i++) {
	        key = attrWhitelist[i];
	        attr = elem.getAttribute(key);
	        if (attr) {
	            out.push('[' + key + '="' + attr + '"]');
	        }
	    }
	    return out.join('');
	}
Returns a simple, query-selector representation of a DOM element
e.g. [HTMLElement] => input#foo.btn[name=baz]
@param HTMLElement
@returns {string}