- 1st way (I don't like it, it's long) but it suits for checking object has the field or not (2nd way is not applied)
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) {
// Element has this attribute
}