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 trialKarl Russell Sumando Menil
Full Stack JavaScript Techdegree Student 4,004 Points"Job Role" menu. Any hints, suggestions and comments are welcome thank you in advance for your help!!!
Adjacent to the "Job Role" menu on the page is the "Other job role" field. This field should be hidden by default, and only be displayed if the user selects the "Other" option from the "Job Role" drop-down menu. And if the user selects any other option, the "Other job role" field should be hidden from view.
Programming the "Job Role" section requires working with the following elements:
The "Job Role" <select> element The "Other job role" <input type="text"> element Create variables to reference the "Job Role" <select> element and the "Other job role" <input type="text"> element. Log the variables out to the console to ensure the correct elements are being referenced. Use the "Other job role" variable to hide this element by default. Use the variable for the "Job Role" menu to listen for the change event on this element. When a "change" is detected, use a conditional statement to check the value property of the element. The event.target statement will be helpful here. Log out the condition and the event.target’s value to inspect them. You’ll have to make a selection in the "Job Role" menu to print those log statements to the console. In the conditional, if the value of the event.target is equal to "other", display the “Other job role” field. And if the value is anything, hide it. Now save and refresh the page, and when the "Other" option is selected/deselected from "Job Role" menu, the "Other job role" field should be visible/hidden on the page.