Answers for "jquery check if element hav attribute"

1

jquery check if attribute exists

var attr = $(this).attr('name');

// For some browsers, `attr` is undefined; for others,
// `attr` is false.  Check for both.
if (typeof attr !== typeof undefined && attr !== false) {
    // ...
}
Posted by: Guest on March-14-2020

Code answers related to "jquery check if element hav attribute"

Code answers related to "Javascript"

Browse Popular Code Answers by Language