SyntaxFix
Write A Post
Hire A Developer
Questions
You can use .attr() as a part of however you plan to toggle it:
$("button").attr("aria-expanded","true");