HTML Forms
Acknowledgements: www.w3schools.com
1Computer Network & Web Tech (SET, JU)
HTML Forms
 HTML Forms used to collect user input
 <form> element defines an HTML form
<form>
.
form elements
.
</form>
 An HTML form contains form elements
 Different types of input elements, like text fields,
checkboxes, radio buttons, submit buttons, and more
First name:
Last name:
2Computer Network & Web Tech (SET, JU)
Bose
Form Attributes
Element Description
action Specifies an address (url) where to submit
the form (default)
autocomplete Specifies if the browser should
autocomplete the form (default: on).
enctype Specifies the encoding of the submitted data
(default: is url-encoded).
method Specifies the HTTP method used when
submitting the data
name Used to identify the form
novalidate Specifies that the browser should not
validate the form.
target Specifies the target of the address in the
action attribute
3Computer Network & Web Tech (SET, JU)
Form Attributes (contd..)
<form action="/action_page.php" novalidate
method=“get”>
E mail: <input type="email" name="user_email”>
<input type="submit” formtarget="_blank”
value="Submit to a new window">
<input type="submit" formaction="/action_page2.php”
value="Submit as admin">
</form>
(see 1a.htm, 1b.htm)
4Computer Network & Web Tech (SET, JU)
Method Attribute
 Default method when submitting form data is GET
 When GET is used, the submitted form data will be visible in the
page address field
action_page.php?firstname=Mickey&lastname=Mouse
 Suited for short, insensitive information
 When POST is used, submitted data is part of body, not visible in
page address field
 Used for sensitive information
 POST has no size limitations,
can be used to send large amounts of data
5Computer Network & Web Tech (SET, JU)
Input Element
 <input> - most important form element
 Can be displayed in different ways depending on type attribute
Type Description
<input type="text"> Defines a one-line text input field
<input type="radio"> Defines a radio button
(for selecting one of many choices)
<input type="submit"> Defines a submit button
(for submitting the form)
6Computer Network & Web Tech (SET, JU)
Text Input
 <input> - most important form element
 Can be displayed in different ways depending on type attribute
• Attributes
Readonly, disabled, maxlength, size, required, autofocus,
autocomplete, placeholder, pattern, title, max, min, step
 Default width of a text field is 20 characters. (see 1.htm)
<form>
First name:<br>
<input type="text" name="firstname” value=“Arnab” size=20> <br>
Last name:<br>
<input type="text" name="lastname” value=“Bose” size=30 >
</form>
7Computer Network & Web Tech (SET, JU)
Text Input (contd..)
<form autocomplete=“on”>
First name:
<input type="text" name="firstname”> <br>
Last name:
<input type="text" name="lastname”> <br>
Email:
<input type="text" name=“email” autocomplete=“off”> <br>
Country Code:
<input type="text" name=“cntrycode” pattern=“[A-Za-z]{3}
title="Three letter country code”>
</form>
8Computer Network & Web Tech (SET, JU)
Password
<input type=“password”>
<form>
First name:
<input type="text" name="firstname”> <br>
Last name:
<input type="text" name="lastname”> <br>
Password:
<input type=“password" name=“psw”> <br>
</form>
9Computer Network & Web Tech (SET, JU)
Submit Button
<input type=“submit”>
 Defines a button for submitting form data to a form handler
o Typically a server page with a script for processing the data
o Specified in the form's action attribute
o If action attribute omitted, handled by the same page
 If value for type “submit” element omitted, default text
<form action=“/action_page.php”>
First name:
<input type="text" name="firstname”> <br>
Last name:
<input type="text" name="lastname”> <br>
<input type=“submit" value=“submit”> <br>
</form> 10Computer Network & Web Tech (SET, JU)
Reset Button
<input type=“reset”>
 Defines a reset button
o Will reset all form values to their default values
<form action=“/action_page.php”>
First name:
<input type="text" name="firstname”> <br>
Last name:
<input type="text" name="lastname”> <br>
<input type=“submit" value=“submit”> <br>
<input type=“reset" >
</form>
11Computer Network & Web Tech (SET, JU)
Radio Buttons
<input type=“radio”>
 Defines a radio button
o lets a user select ONLY ONE out of
a limited number of choices
<form action=“/action_page.php”>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
</form>
12Computer Network & Web Tech (SET, JU)
Checkbox
<input type=“checkbox”>
 Defines a checkbox
o Checkboxes let a user select ZERO or MORE options of a limited
number of choices
<form action=“/action_page.php”>
<input type="checkbox" name="vhcl1" value="Bike"> I have a bike<br>
<input type="checkbox" name="vhcl2" value="Car"> I have a car
</form> see 2.htm
13Computer Network & Web Tech (SET, JU)
Button
<input type=“button”>
 Defines a clickable button
<form action=“/action_page.php”>
First name:
<input type="text" name="firstname”> <br>
Last name:
<input type="text" name="lastname”> <br>
<input type=“button“ onclick="alert('Hello
World!')" value="Click Me!">
</form>
14Computer Network & Web Tech (SET, JU)
Addition input types – HTML5
 When not supported by older browsers, act as text
o number, color, date, month,week, range, email, URL
<input type=“number" name=“qty” min=“0”
name=“100” step=“10” >
<input type=“range" name=“points” min=“0”
name=“100” step=“2” value=“50” >
<input type="email" name="email">
<input type=“URL" name=“homepage">
15Computer Network & Web Tech (SET, JU)
HTML5 input types (contd..)
Depending on browser support, a date or time picker can show up in the input field
Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
Enter a date after 2000-01-01:
<input type="datetime-local" name="bday" min="2000-01-
02">
<input type="month" name="bdaymonth“ >
<input type="week" name="week_year">
<input type="time" name="usr_time">
<input type="color" name="favcolor">
See 3.htm
16Computer Network & Web Tech (SET, JU)
Select Element
<select>
 Defines a dropdown list
o <option> elements defines an option that can be selected
o By default, the first item in the drop-down list is selected.
o To define a pre-selected option, add selected attribute to option
<select name=“cars”>
<option value=“audi”> Audi </option>
<option value=“mercedes” selected>
Mercedes </option>
<option value=“bmw”> BMW </option>
<select name=“cars”>
</form> 17Computer Network & Web Tech (SET, JU)
DataList Element
<datalist>
 Defines a dropdown list for an input element (new in HTML5)
o Users will see drop-down list of pre-defined options as they input data
o list attribute of <input> element must refer id attribute of <datalist>
<input list=“browsers”>
<datalist id=“browsers”>
<option value=“firefox”> Firefox </option>
<option value=“chrome”> chrome </option>
<option value=“ie”> Internet Explorer</option>
< /datalist>
18Computer Network & Web Tech (SET, JU)
Textarea Element
<textarea>
 Defines a multiline input field
o rows and columns can be defined
o row attribute defines number of visible lines
o col attribute defines visible width
<textarea name=“message” rows=“10” cols=“30” >
The fox jumped over the fence </textarea>
See 4.htm
19Computer Network & Web Tech (SET, JU)
Some more Elements..
Element Description
<label> Defines a label for an <input> element
<fieldset> Groups related elements in a form
<optgroup> Defines a group of related options in a drop-
down list
<output> Defines the result of a calculation
20Computer Network & Web Tech (SET, JU)
Block & Inline Elements
Grouping Elements (DIV,SPAN)
21Computer Network & Web Tech (SET, JU)
Block Element
 Start on a new line & take full available width
 Examples
o <h1> to <h6>
o <p>
o <div>
o <form>
22Computer Network & Web Tech (SET, JU)
Div Element
 Grouping element, generally used to style a block of content
 Often used as container for other elements
 No required attributes, often used with <style> & <class>
 Example
<div style==“backgroundcolor:black; color:white; padding:20px;” >
<h2> London </h2>
<p> Capital of UK </p>
</div>
See h1.htm 23Computer Network & Web Tech (SET, JU)
DIV: Using class attribute
Makes it easier to define equal styles for elements with same class
Example
<head>
<style>
div.cities { background-color: black;
color: white;
padding: 20px;}
</style>
</head>
24Computer Network & Web Tech (SET, JU)
DIV: Using class attribute (contd..)
<body>
<div class= ”cities”>
<h2> London </h2>
<p> Capital of UK </p>
</div>
<div class= ”cities”>
<h2>Paris</h2>
<p> Capital of France </p>
</div>
</head>
See h3class.htm 25Computer Network & Web Tech (SET, JU)
Inline Elements
 Do not start on a new line
 Take up as much width as necessary
 Examples
o <span>
o <img>
o <a>
26Computer Network & Web Tech (SET, JU)
SPAN Element
 Grouping element, usually container for some text i.e. defines a
particular section of text inline
 Used with CSS to style parts of content
 No required attributes, often used with <style> & <class>
 Example
<p> This is an <span style==“color:red; font-size:18px;” >
important topic </span> for the subject
</p>
see b2.htm
27Computer Network & Web Tech (SET, JU)
SPAN: Using class attribute
Example
<head>
<style>
span.note { color: red; font-size: 120%;}
</style>
</head>
<body>
<h2> My <span class= ”note”> Important </span> </h2>
<p> This is an <span class= ”note”>
Important </span> text </p>
</body>
b4class.htm
28Computer Network & Web Tech (SET, JU)

More Related Content

PPTX
HTML Forms
PPTX
html forms
PPTX
HTML Forms Tutorial
PDF
2. HTML forms
PPTX
Html form tag
PPTX
Html tables, forms and audio video
PPTX
Forms with html5 (1)
PPSX
HTML5 - Forms
HTML Forms
html forms
HTML Forms Tutorial
2. HTML forms
Html form tag
Html tables, forms and audio video
Forms with html5 (1)
HTML5 - Forms

What's hot (20)

PPTX
HTML Forms
PPTX
html 5 new form attribute
PDF
Html forms
PPTX
Web engineering - HTML Form
PPTX
New Form Element in HTML5
PPT
20 html-forms
PPTX
Forms in html5
PPTX
Html forms
PDF
[Basic HTML/CSS] 4. html - form tags
PPTX
Html forms
PPTX
Building html forms
PPTX
Form using html and java script validation
PPTX
PPT
Html class-04
ODP
Tut 06 (forms)
PPTX
Web topic 20 2 html forms
PPTX
Web topic 20 1 html forms
PPTX
Html 5-tables-forms-frames (1)
PPT
05 html-forms
HTML Forms
html 5 new form attribute
Html forms
Web engineering - HTML Form
New Form Element in HTML5
20 html-forms
Forms in html5
Html forms
[Basic HTML/CSS] 4. html - form tags
Html forms
Building html forms
Form using html and java script validation
Html class-04
Tut 06 (forms)
Web topic 20 2 html forms
Web topic 20 1 html forms
Html 5-tables-forms-frames (1)
05 html-forms
Ad

Similar to Html 4 (20)

PPTX
HNDIT1022 Week 03 Part 2 Theory information.pptx
PPTX
Designing web pages html forms and input
PPTX
Web forms - Learn web development (1).pptx
PPTX
Html form
PPT
Web forms and html lecture Number 4
PPTX
unit2_HTML_Forms fundamentals of html and crore concepts.pptx
DOCX
PPTX
HTML Forms
PDF
COMP-10-ONLINE-FORMS Powerpoint Presentation
PPT
Chapter09
PDF
CSS_Forms.pdf
PPTX
Html - Tables, Forms and Frames by Telerik Academy
PDF
Cmsc 100 (web forms)
PPTX
HTML Forms: The HTML element represents a document section containing interac...
PPTX
Lecture 3 Introduction to HTML FORM AND CSS.pptx
PDF
Html5ppt
PPTX
HTML and CSS part 2
PPTX
Section1 HTML (part2) Web technology for b
PDF
HTML5 New and Improved
HNDIT1022 Week 03 Part 2 Theory information.pptx
Designing web pages html forms and input
Web forms - Learn web development (1).pptx
Html form
Web forms and html lecture Number 4
unit2_HTML_Forms fundamentals of html and crore concepts.pptx
HTML Forms
COMP-10-ONLINE-FORMS Powerpoint Presentation
Chapter09
CSS_Forms.pdf
Html - Tables, Forms and Frames by Telerik Academy
Cmsc 100 (web forms)
HTML Forms: The HTML element represents a document section containing interac...
Lecture 3 Introduction to HTML FORM AND CSS.pptx
Html5ppt
HTML and CSS part 2
Section1 HTML (part2) Web technology for b
HTML5 New and Improved
Ad

More from pavishkumarsingh (19)

PPTX
PPTX
PPTX
Javascript 2
PPTX
Javascript 1
PPTX
PPTX
PPTX
PPTX
PPTX
DOC
Final action script
PDF
Multimedia system
PDF
Visual basic
DOC
Human - compuTer interaction
PDF
Multimedia system(OPEN DOCUMENT ARCHITECTURE AND INTERCHANGING FORMAT)
PDF
Authoring metaphors
DOC
Final action script for visual basic
DOC
Cognitive aspects in human computer interaction
DOC
list script and flowchart
DOCX
Networks
Javascript 2
Javascript 1
Final action script
Multimedia system
Visual basic
Human - compuTer interaction
Multimedia system(OPEN DOCUMENT ARCHITECTURE AND INTERCHANGING FORMAT)
Authoring metaphors
Final action script for visual basic
Cognitive aspects in human computer interaction
list script and flowchart
Networks

Recently uploaded (20)

PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Introduction to Power System StabilityPS
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPTX
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
PPTX
mechattonicsand iotwith sensor and actuator
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
CyberSecurity Mobile and Wireless Devices
PDF
Java Basics-Introduction and program control
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
Design of Material Handling Equipment Lecture Note
DOC
T Pandian CV Madurai pandi kokkaf illaya
PPTX
Petroleum Refining & Petrochemicals.pptx
PDF
First part_B-Image Processing - 1 of 2).pdf
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PDF
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Introduction to Power System StabilityPS
"Array and Linked List in Data Structures with Types, Operations, Implementat...
distributed database system" (DDBS) is often used to refer to both the distri...
CONTRACTS IN CONSTRUCTION PROJECTS: TYPES
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Information Storage and Retrieval Techniques Unit III
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
mechattonicsand iotwith sensor and actuator
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
CyberSecurity Mobile and Wireless Devices
Java Basics-Introduction and program control
Module 8- Technological and Communication Skills.pptx
Design of Material Handling Equipment Lecture Note
T Pandian CV Madurai pandi kokkaf illaya
Petroleum Refining & Petrochemicals.pptx
First part_B-Image Processing - 1 of 2).pdf
August 2025 - Top 10 Read Articles in Network Security & Its Applications
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...

Html 4

  • 2. HTML Forms  HTML Forms used to collect user input  <form> element defines an HTML form <form> . form elements . </form>  An HTML form contains form elements  Different types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more First name: Last name: 2Computer Network & Web Tech (SET, JU) Bose
  • 3. Form Attributes Element Description action Specifies an address (url) where to submit the form (default) autocomplete Specifies if the browser should autocomplete the form (default: on). enctype Specifies the encoding of the submitted data (default: is url-encoded). method Specifies the HTTP method used when submitting the data name Used to identify the form novalidate Specifies that the browser should not validate the form. target Specifies the target of the address in the action attribute 3Computer Network & Web Tech (SET, JU)
  • 4. Form Attributes (contd..) <form action="/action_page.php" novalidate method=“get”> E mail: <input type="email" name="user_email”> <input type="submit” formtarget="_blank” value="Submit to a new window"> <input type="submit" formaction="/action_page2.php” value="Submit as admin"> </form> (see 1a.htm, 1b.htm) 4Computer Network & Web Tech (SET, JU)
  • 5. Method Attribute  Default method when submitting form data is GET  When GET is used, the submitted form data will be visible in the page address field action_page.php?firstname=Mickey&lastname=Mouse  Suited for short, insensitive information  When POST is used, submitted data is part of body, not visible in page address field  Used for sensitive information  POST has no size limitations, can be used to send large amounts of data 5Computer Network & Web Tech (SET, JU)
  • 6. Input Element  <input> - most important form element  Can be displayed in different ways depending on type attribute Type Description <input type="text"> Defines a one-line text input field <input type="radio"> Defines a radio button (for selecting one of many choices) <input type="submit"> Defines a submit button (for submitting the form) 6Computer Network & Web Tech (SET, JU)
  • 7. Text Input  <input> - most important form element  Can be displayed in different ways depending on type attribute • Attributes Readonly, disabled, maxlength, size, required, autofocus, autocomplete, placeholder, pattern, title, max, min, step  Default width of a text field is 20 characters. (see 1.htm) <form> First name:<br> <input type="text" name="firstname” value=“Arnab” size=20> <br> Last name:<br> <input type="text" name="lastname” value=“Bose” size=30 > </form> 7Computer Network & Web Tech (SET, JU)
  • 8. Text Input (contd..) <form autocomplete=“on”> First name: <input type="text" name="firstname”> <br> Last name: <input type="text" name="lastname”> <br> Email: <input type="text" name=“email” autocomplete=“off”> <br> Country Code: <input type="text" name=“cntrycode” pattern=“[A-Za-z]{3} title="Three letter country code”> </form> 8Computer Network & Web Tech (SET, JU)
  • 9. Password <input type=“password”> <form> First name: <input type="text" name="firstname”> <br> Last name: <input type="text" name="lastname”> <br> Password: <input type=“password" name=“psw”> <br> </form> 9Computer Network & Web Tech (SET, JU)
  • 10. Submit Button <input type=“submit”>  Defines a button for submitting form data to a form handler o Typically a server page with a script for processing the data o Specified in the form's action attribute o If action attribute omitted, handled by the same page  If value for type “submit” element omitted, default text <form action=“/action_page.php”> First name: <input type="text" name="firstname”> <br> Last name: <input type="text" name="lastname”> <br> <input type=“submit" value=“submit”> <br> </form> 10Computer Network & Web Tech (SET, JU)
  • 11. Reset Button <input type=“reset”>  Defines a reset button o Will reset all form values to their default values <form action=“/action_page.php”> First name: <input type="text" name="firstname”> <br> Last name: <input type="text" name="lastname”> <br> <input type=“submit" value=“submit”> <br> <input type=“reset" > </form> 11Computer Network & Web Tech (SET, JU)
  • 12. Radio Buttons <input type=“radio”>  Defines a radio button o lets a user select ONLY ONE out of a limited number of choices <form action=“/action_page.php”> <input type="radio" name="gender" value="male" checked> Male<br> <input type="radio" name="gender" value="female"> Female<br> <input type="radio" name="gender" value="other"> Other </form> 12Computer Network & Web Tech (SET, JU)
  • 13. Checkbox <input type=“checkbox”>  Defines a checkbox o Checkboxes let a user select ZERO or MORE options of a limited number of choices <form action=“/action_page.php”> <input type="checkbox" name="vhcl1" value="Bike"> I have a bike<br> <input type="checkbox" name="vhcl2" value="Car"> I have a car </form> see 2.htm 13Computer Network & Web Tech (SET, JU)
  • 14. Button <input type=“button”>  Defines a clickable button <form action=“/action_page.php”> First name: <input type="text" name="firstname”> <br> Last name: <input type="text" name="lastname”> <br> <input type=“button“ onclick="alert('Hello World!')" value="Click Me!"> </form> 14Computer Network & Web Tech (SET, JU)
  • 15. Addition input types – HTML5  When not supported by older browsers, act as text o number, color, date, month,week, range, email, URL <input type=“number" name=“qty” min=“0” name=“100” step=“10” > <input type=“range" name=“points” min=“0” name=“100” step=“2” value=“50” > <input type="email" name="email"> <input type=“URL" name=“homepage"> 15Computer Network & Web Tech (SET, JU)
  • 16. HTML5 input types (contd..) Depending on browser support, a date or time picker can show up in the input field Enter a date before 1980-01-01: <input type="date" name="bday" max="1979-12-31"> Enter a date after 2000-01-01: <input type="datetime-local" name="bday" min="2000-01- 02"> <input type="month" name="bdaymonth“ > <input type="week" name="week_year"> <input type="time" name="usr_time"> <input type="color" name="favcolor"> See 3.htm 16Computer Network & Web Tech (SET, JU)
  • 17. Select Element <select>  Defines a dropdown list o <option> elements defines an option that can be selected o By default, the first item in the drop-down list is selected. o To define a pre-selected option, add selected attribute to option <select name=“cars”> <option value=“audi”> Audi </option> <option value=“mercedes” selected> Mercedes </option> <option value=“bmw”> BMW </option> <select name=“cars”> </form> 17Computer Network & Web Tech (SET, JU)
  • 18. DataList Element <datalist>  Defines a dropdown list for an input element (new in HTML5) o Users will see drop-down list of pre-defined options as they input data o list attribute of <input> element must refer id attribute of <datalist> <input list=“browsers”> <datalist id=“browsers”> <option value=“firefox”> Firefox </option> <option value=“chrome”> chrome </option> <option value=“ie”> Internet Explorer</option> < /datalist> 18Computer Network & Web Tech (SET, JU)
  • 19. Textarea Element <textarea>  Defines a multiline input field o rows and columns can be defined o row attribute defines number of visible lines o col attribute defines visible width <textarea name=“message” rows=“10” cols=“30” > The fox jumped over the fence </textarea> See 4.htm 19Computer Network & Web Tech (SET, JU)
  • 20. Some more Elements.. Element Description <label> Defines a label for an <input> element <fieldset> Groups related elements in a form <optgroup> Defines a group of related options in a drop- down list <output> Defines the result of a calculation 20Computer Network & Web Tech (SET, JU)
  • 21. Block & Inline Elements Grouping Elements (DIV,SPAN) 21Computer Network & Web Tech (SET, JU)
  • 22. Block Element  Start on a new line & take full available width  Examples o <h1> to <h6> o <p> o <div> o <form> 22Computer Network & Web Tech (SET, JU)
  • 23. Div Element  Grouping element, generally used to style a block of content  Often used as container for other elements  No required attributes, often used with <style> & <class>  Example <div style==“backgroundcolor:black; color:white; padding:20px;” > <h2> London </h2> <p> Capital of UK </p> </div> See h1.htm 23Computer Network & Web Tech (SET, JU)
  • 24. DIV: Using class attribute Makes it easier to define equal styles for elements with same class Example <head> <style> div.cities { background-color: black; color: white; padding: 20px;} </style> </head> 24Computer Network & Web Tech (SET, JU)
  • 25. DIV: Using class attribute (contd..) <body> <div class= ”cities”> <h2> London </h2> <p> Capital of UK </p> </div> <div class= ”cities”> <h2>Paris</h2> <p> Capital of France </p> </div> </head> See h3class.htm 25Computer Network & Web Tech (SET, JU)
  • 26. Inline Elements  Do not start on a new line  Take up as much width as necessary  Examples o <span> o <img> o <a> 26Computer Network & Web Tech (SET, JU)
  • 27. SPAN Element  Grouping element, usually container for some text i.e. defines a particular section of text inline  Used with CSS to style parts of content  No required attributes, often used with <style> & <class>  Example <p> This is an <span style==“color:red; font-size:18px;” > important topic </span> for the subject </p> see b2.htm 27Computer Network & Web Tech (SET, JU)
  • 28. SPAN: Using class attribute Example <head> <style> span.note { color: red; font-size: 120%;} </style> </head> <body> <h2> My <span class= ”note”> Important </span> </h2> <p> This is an <span class= ”note”> Important </span> text </p> </body> b4class.htm 28Computer Network & Web Tech (SET, JU)

Editor's Notes

  • #4: When autocomplete is on, the browser automatically completes the input values based on values that the user has entered before.
  • #8: The value attribute specifies the initial value for an input field: readonly attribute specifies that the input field is read only (cannot be changed) disabled attribute specifies that the input field is disabled A disabled input field is unusable and un-clickable, and its value will not be sent when submitting the form The size attribute specifies the size (in characters) for the input field: pattern attribute works with the following input types: text, search, url, tel, email, and password