Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Web Accessibility Compliance Accessible UI Patterns Keyboard Interactivity

Luci Peterson
Luci Peterson
1,460 Points

Add/remove elements vs. show/hide for web accessibility

I was taught when learning how to use JavaScript to manipulate the DOM, that you should never add or remove elements unless absolutely necessary, that you should only show or hide them from the user's view, because adding and removing can cause problems (I don't remember why). However in the Web Accessibility Compliance course, it says that users should be able to understand and interact with your website even if Javascript and CSS are disabled in their browser settings. What then is the best way to show and hide elements while still adhering to web accessibility standards and writing good code?