var attr = $(this).attr('name'); // For some browsers, `attr` is undefined; for others, // `attr` is false. Check for both. if (typeof attr !== 'undefined' && attr !== false) { // ... }
2.1m questions
2.1m answers
60 comments
57.0k users