* @returns {string} Returns the string representation of the element.
(element)
| 1064 | * @returns {string} Returns the string representation of the element. |
| 1065 | */ |
| 1066 | function startingTag(element) { |
| 1067 | element = jqLite(element).clone(); |
| 1068 | try { |
| 1069 | // turns out IE does not let you set .html() on elements which |
| 1070 | // are not allowed to have children. So we just ignore it. |
| 1071 | element.empty(); |
| 1072 | } catch (e) {} |
| 1073 | var elemHtml = jqLite('<div>').append(element).html(); |
| 1074 | try { |
| 1075 | return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : |
| 1076 | elemHtml. |
| 1077 | match(/^(<[^>]+>)/)[1]. |
| 1078 | replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); }); |
| 1079 | } catch (e) { |
| 1080 | return lowercase(elemHtml); |
| 1081 | } |
| 1082 | |
| 1083 | } |
| 1084 | |
| 1085 | |
| 1086 | ///////////////////////////////////////////////// |
no test coverage detected