Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume you are already writing code inside the tags (you do NOT need to write et

ID: 3576809 • Letter: A

Question

Assume you are already writing code inside the tags (you do NOT need to write etc.. Radios must be of the name-group "radios", the first one, has id "gold" while the second one must have id "platinum" The register button must call a function called registerUser() when clicked. You do not need to write the JavaScript code for the function, or the calculation. Define a DOM event listener in the "Register" input you create, which on click, will pass the values of the userName and email input boxes to a function called register User

Explanation / Answer

name is an attribute used to give a name to the control which is sent to the server to be recognized and get the value. If you are using javascript which is a client side scripting language, you can get the value by the id of the controls, but in case of server side scripting or code, you need to access using name attribute. So always use id and name both for your control.

Also, this is specifially mentioned in the question that both the radio butons need to be of same name-group "radios". This is because, you want to group both of the radio buttons into one, so that user can select either one of them.

But, if you do not group the radio buttons or give different value of name then the two radio buttons are not grouped. So now user will be able to select both the radio button.

Every control in HTML has name attribute.
I would recommend the online resource www.w3schools.com for complete knowledge of HTML controls and tags.

feel free to ask if you have any doubt :)