MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / getClass

Function getClass

02.Components/Part-2/js/vue.js:1295–1301  ·  view source on GitHub ↗

* For IE9 compat: when both class and :class are present * getAttribute('class') returns wrong value... * * @param {Element} el * @return {String}

(el)

Source from the content-addressed store, hash-verified

1293 */
1294
1295 function getClass(el) {
1296 var classname = el.className;
1297 if (typeof classname === 'object') {
1298 classname = classname.baseVal || '';
1299 }
1300 return classname;
1301 }
1302
1303 /**
1304 * In IE9, setAttribute('class') will result in empty class

Callers 2

addClassFunction · 0.70
removeClassFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected