jovanyoshioka / CityFinder

Provides suggestions for places to live and visit based on user preferences.
0 stars 0 forks source link

[Preferences] Implement Preference / Rating Row #2

Closed jovanyoshioka closed 6 months ago

jovanyoshioka commented 7 months ago

Task 1.) Implement Design A (only red circled portion). Use the <fieldset> element to group the preference text (i.e., "XXXXX" in design) and rating buttons. Use the <p> element for the preference text. Use the <input type="radio" /> element for each of the rating buttons. Each rating button will have a value attribute; you can set these values as 1-5 depending on the position of the button (i.e., the leftmost button will have a value of 1, and the rightmost a value of 5).

2.) Add an onchange event attribute to your rating buttons that saves the selected rating in a variable. Temporarily use alert to display the value of this variable to verify that the correct value is being saved each time a rating button is clicked.

Files You will find comments in components/preferences/preferences.js and components/preferences/preferences.css that tells you where to write your code.

Resources Fieldset (Use <p> instead of <legend>): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset Radio Input: https://www.w3schools.com/tags/att_input_type_radio.asp onchange Event: https://codepen.io/ramtob/pen/qZWzeE alert: https://www.w3schools.com/jsref/met_win_alert.asp

Design A preferences