HTML elements used to allow for easy data input from users
Examples (from Duckett on HTML): Online shopping, registrations, search engines
Text: 1/more lines of text (possibly hidden as it is input)
Multiple-choice: buttons & drop-downs
“Clickables” (to do something)
HTML anatomy (refer to Ducket on HTML p151)
<form action="urlforpagereceivinginfo" method="get"> the method can also be post.
<input type="" name="" maxlength=""> type values may be text for single-line input, password for blocked-out; name is an identifier for particular input field, maxlength caps character count;
<form action=""><textarea name=""></textarea></form> Note closing tag required. Displays given text before user adds input.
Variety of inputs that can be reacted to programmatically
Events fire / have been raised; scripts trigger
JS uses DOM manipulation to interact with/based on firing events
Can – but should not – use deprecated system of HTML handlers
Event listeners: more recent browsers use this method approach to linking elements to events and then calling functions