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

JavaScript

Target dropdown select with JavaScript?

Hi,

I'd like to display an error message on my form if the user hasn't selected an option from a dropdown list. I'd like to do it with JavaScript.

How can I do that? Thanks

1 Answer

For straight to the point examples I like w3schools approach.

Yes, I tried this, but I don't want an alert message. I'd like to display a text underneath the field.