jquery find by attribute code example
Example 1: name selector jquery
$('td[name ="tcol1"]')
$('td[name^="tcol"]' )
$('td[name$="tcol"]' )
$('td[name*="tcol"]' )
Example 2: custom attribute jquery selector
$("ul[data-group='Companies'] li[data-company='Microsoft']")
$("ul[data-group='Companies'] li:not([data-company='Microsoft'])")
Example 3: jquery find by data attribute
$('.slide-link[data-slide="0"]').addClass('active');
Example 4: jquery show hide based on data attribute
$('form')
.children()
.filter(function(){
return $(this).data('show') === 'pro';
})
.show();
$('form')
.children()
.filter(function(){
return $(this).data('show') === 'home';
})
.hide();