jquery - Instead of $.closest in Angularjs -


i want implement code in directive in jqlite doesn't work how should done?

 var thiscell = element.closest('.sampleclass'); 

you have implement functionality manually, example:

var thiscell = (function closest(e, classname) {   if (e[0].nodename == "html") {     return null;   } else if (e.hasclass(classname)) {     return e;   } else {     return closest(e.parent(), classname);   } })(element, "sampleclass"); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -