Lecture No. 6: Forms and Multimedia Elements

HTML Forms

Forms are used to collect user input. Data entered into a form can be sent to a server for processing.

Basic Syntax

<form action="server.php" method="post">...</form>

Common Form Elements

TagDescription
<input>Text, password, checkbox, radio, etc.
<textarea>Multi-line input field
<button>Clickable button
<select> & <option>Dropdown list with choices
<label>Label for form inputs

Input Types

text, password, email, number, checkbox, radio, submit, reset, file, date, color

Multimedia Elements

HTML5 provides native support for adding audio and video to web pages.

Image Element

<img src="image.jpg" alt="Description">

Audio Element

<audio controls>
  <source src="sound.mp3" type="audio/mpeg">
</audio>

Video Element

<video controls width="300">
  <source src="movie.mp4" type="video/mp4">
</video>

Attributes: controls, autoplay, loop, muted, poster