I have these code,
export default MainContent = () => {
handleClick = (e) => {
const attr = e.target.getAttribute("aria-expanded");
};
return (
<div aria-expanded='false' onClick={handleClick}>1</div>
<div aria-expanded='false' onClick={handleClick}>2</div>
<div aria-expanded='false' onClick={handleClick}>3</div>
);
}
What I need to do is set aria-expanded='true' when click. I can't make this to data-expanded. And I only need to change clicked item. Is there any way to do this?