how to Send data from html page to process in javascript? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

how to Send data from html page to process in javascript?

I need to process data strings and numbers in javascript but I don't know how to do that! Am I need form elements? and what should be in action attribute?

6th Dec 2017, 8:58 AM
Saeed
Saeed - avatar
3 Answers
+ 4
document.formName.formElementName.value
6th Dec 2017, 9:05 AM
ℬℯℳℬℐ
ℬℯℳℬℐ - avatar
+ 4
or document.getElementById(id)
6th Dec 2017, 9:06 AM
ℬℯℳℬℐ
ℬℯℳℬℐ - avatar
+ 3
Javascript could get any data information (form input or other elements) from a linked HTML. Javascript access the HTML elements by its ID using getElementById() function or by its CLASS using getElementsByClassName() or by its TAG using getElementsByTagName() Please check out MDN web docs or w3schools for more information.
6th Dec 2017, 9:09 AM
Calviղ
Calviղ - avatar