Reputation: 7589
I am setting the aria-expanded attribute's value with jquery. I am confused whether I should do:
$(".dropdown-toggle").attr("aria-expanded", true);
or
$(".dropdown-toggle").attr("aria-expanded", "true");
Should true be treated as a string or simply a javascript data type?
Upvotes: 1
Views: 723
Reputation: 2455
We can use both way to set aria-expanded attribute. Both will set attribute correctly.
$(".dropdown-toggle").attr("aria-expanded", "true");
$(".dropdown-toggle").attr("aria-expanded", true);
Normally first option is used but we can use both.
Upvotes: 1