The <form> Element

The HTML: <form> element is used to create an HTML form for user input:

<form>

</form> The Element The HTML element is the most used form element.

An element can be displayed in many ways, depending on the type attribute.

Lists in HTML ::

-for example, is an unordered list, created with the UL element:

HTML tables

Tables can be a useful way of organising content on a web page, particularly text. A table is defined with the <table> tag


## What are web forms?

## The <label> Element

The Submit Button

The <input type=”submit”> defines a button for submitting the form data to a form-handler.






```


Events

Types of events:

  1. UI events: User interactions with the browser’s user interface (ex: load, resize and scroll)
  2. Keyboard events: interactions with keyboards (ex: keypress, up, down)
  3. Mouse events : interactions using mouse, trackpad or touchscreen (ex: click, hover, double-click )
  4. Focus event: when an element gains or loses focus
  5. Form event: when a user interacts with a form
  6. Mutation evens: when the DOM structure is changed by script

Event flow:

It is important to keep track of order of which events fire. This is known as event flow; the flow can be in either direction

JavaScript HTML DOM EventListener

Events Types:

  1. Mouse events
    • From Netscape 2 onwards all browsers recognize two events on links. When the user moves the mouse into the link area, the mouseover event fires. When he clicks on it the click event fires
  2. Form events
    • Forms recognize the submit and reset events, which — predictably — fire when the user submits or resets a form. The submit event is the key of any form validation script
  3. interface events
    • Interface events are events that are not caused by user actions, but by the result of user actions. When the user clicks on any element he always causes a click event. When clicking on the element has special meaning

Creating custom events

Note:


Table Of Content