$(".focus-button").addClass('active');
$(".focus-button[data-expand='true']").addClass('active');
If I store the class selector in a variable like:
var btn = $(".focus-button");
The variable can be used in the code as
btn.addClass('active'); // This is correct
btn[data-expand='true'].addClass('active'); // This is wrong
May I know what is the right way to use variable with attributes.
filterapi.jquery.com/filterbtn.filter("[data-expand='true']")