Answers for "if input has attribute jquery"

2

jquery if attribute

if ( $('html').attr('lang') == 'fr-FR' ) {
    // do this
} else {
    // do that
}
Posted by: Guest on January-19-2021
0

jquery has attribute

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) {
    // ...
}
Posted by: Guest on March-17-2022

Code answers related to "if input has attribute jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language