Make your website interactive with JavaScript
Difficulty: Beginner ● Progress: 0 / 0 modules completed
Read/Modify an attribute
In the previous module, we learned how to select an element, now we're going to see how to retrieve or change its value, its attributes, its content, its style, etc.
To start, you should know that retrieving the value of an attribute, or modifying it, is done in almost the same way. Let's take an example element, along with a piece of CSS:
<button id="my-button">Envoyer</button>
You need a free account to read this module