Data Attribute Selection
Data Attribute Selection
Selectors can describe element state, not just tag names, classes, or IDs. A data-* attribute is often used when the markup carries custom state for JavaScript.
Repeated panels may share the same classes. The state attribute is what tells your script which panel should change.
Your task: Select the settings panel whose data-panel value is "billing". Add is-active to that panel and update its status text to Billing selected. Leave the profile panel unchanged.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Data Attribute Selection
Selectors can describe element state, not just tag names, classes, or IDs. A data-* attribute is often used when the markup carries custom state for JavaScript.
Repeated panels may share the same classes. The state attribute is what tells your script which panel should change.
Your task: Select the settings panel whose data-panel value is "billing". Add is-active to that panel and update its status text to Billing selected. Leave the profile panel unchanged.