What does 'form.elements' do?What does 'this.form' in that '<input...onclick=getScore(this.form)>' do? How percentage,mark sent | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does 'form.elements' do?What does 'this.form' in that '<input...onclick=getScore(this.form)>' do? How percentage,mark sent

I have created a sample quiz. Used forms for getting and posting. Some JS stuff. But I couldn't understand the flow of user response data between the function and the form. I just searched over web and included that part to my code. I understood the JS logic, but couldn't grab the flow of data. Help me. https://code.sololearn.com/WQb056wpjEhw/?ref=app

22nd Sep 2020, 11:44 AM
Nithin•••
1 Answer
+ 2
this in the event attribute means the event itself, so I think this.form means the form that you are selecting right now. (The input tag you put the "this" in) Also, you did great! Your project was awesome! Also, HTML & CSS is for decorating and JS is for interactivity, so HTML & CSS would create the form and the JS would be correcting it. Additionally, I don't know what the form.element meant, so I found it on here: https://www.w3schools.com/jsref/coll_form_elements.asp
22nd Sep 2020, 3:32 PM
:DD
:DD - avatar