how to get aria expanded value in javascript 1

how to get aria expanded value in javascript

document.getElementById('test').getAttribute('aria-expanded')

Here is what the above code is Doing:
1. We’re using the getElementById() method to get the element with the id of test.
2. We’re using the getAttribute() method to get the value of the aria-expanded attribute.
3. We’re using the console.log() method to print the value of the aria-expanded attribute to the console.

Similar Posts