HTML 3
HTML 3
text field
>text field used for taking input(any type of data) from user or
text box allows us to type data.
>text fields are used for typing of username, firstname, pincode,
phone, address etc...
>by using "input" tag we can create textboxes
>user can type any no.of char's but single line, if u want to set a
limit use "maxlength" attribute.
>text field allows you to type data in 1 line.
Syn:
<input type="text" attributes>
Note:
id => used by client-side programming (javascript)
=> used in css also
=> unique (duplicate id are not)
name => used by server-side programming
(servlet/asp.net/php...)
=> either unique or not
hidden field
>an in-visible text field with default value is called a "hidden
field".
>hidden fields are used to send some information about
user/client to a server-side
program with asking the user.
>to perform session tracking, we are using hidden fields.
>these hidden field when you want to submit some fixed text
value to server(that don't want accept from user)
>like normal text fields, hidden fields data is also sent to the
server when we click the submit button.
Syn:
<input type="hidden" name="NAME" value="VAL" attributes>
password control
> password is a text field but the data is not visible.
> it's used for accepting password, otp, verification code,
passcode... from the user.
> password is displayed as * or dot
Syn:
<input type="password" attributes>
number control
>this control used to accept only numerical value (numbers
only) from user
>it prevents typing of alphabets, special chars (in some
browsers), except – and e alphabet.
>but some browser allows to type all these data but given error
while submitting form
> some browsers displaying number fields with
increment/decrement buttons
SYn:
<input type="number" attributes>
attributes:
min => it rep starting value of number field (by default no min)
max => it rep ending value of number field (by default no max)
step => it rep increment/decrement value (by default +1/-1)
reset button
>reset is one type of button, used for reset the form/UI,
meaning it clears all values of form.
>reset button must be part of the "form" tag.
> these button values are not sent to the server.
Syn:
<input type="reset">
submit button
>submit is one type of button, used to submit/send the html
forms/page/UI to a server-side program.
>while submitting the html form, all input parameters (enter by
user), hidden parameter(by programmer) as a "Query String"
ex:
https://www.redbus.co.in/search.aspx ? param-
name=value¶m-name=value &...
param-name => name of text box or name of password field
or name of button...
value => value of text box or value of password field or value
of button...
>outside the form, if we design anything that is not submitted
to the server and without name attribute also not submittable.
>submit button value also sent to server
Syn:
<input type="submit" value="VAL" attributes>
image button
> "image submit button" is used to submit a form to the server.
> when the user clicks on the image button, browser is
submitting data with x-co & y-co of image button
Syn:
<input type="image" src="filename" ...>
check box
>check boxes are used to allow the user to select some options,
for example product, class, color selection, sport selection,
select branch, select collage etc.
>whenever we want to select more than one option use check
box's
>if the checkbox is selected/checked it returns "on'' (true)
value, if the checkbox is unchecked it returns "off" (false) value.
selected => on (SSP), true (CSP)
non selected => off (SSP), false(CSP)
SYn:
<input type="checkbox" attributes>
Note: all check boxes should be created with the same name.
"checked" attribute of the check box makes the checkbox by
default checked, while opening the page.
Syn:checked="checked" before html5 ver
checked since html5 ver
radio button
> RB is used to display two or more options to the user, but
allows the user to select any one of them.
SYn:
<input type="radio" attributes>
Note:
> all RBs should be created with the same name.
> "checked" attribute of RB makes the RB by default selected,
while opening the page.
file
>file used to upload or attachment
>we can upload or attach any type of file, but @time a only one
file
Syn <input type="file" attributes>
attributes:
multiple => it allows multiple to upload @time
accept => filtering type of file
Note:
while uploading file method should be "post" and enctype is
"multipart/form-data"
color
>used to select color by user, selected color we can apply on
any control using JS
Syn: <input type="color">
time
>used to create a time box, where the user can enter/select
time (in the form of hours, minutes and seconds)
Syn:<input type="time" attributes>
datetime
>used to create a date-cum-time control
Syn: <input type="datetime-local" attributes>
month
>used to create a month box, where the user can select a
month.
Syn: <input type="month" ...>
week
>used to create a week box, where the user can select a week.
Syn: <input type="week" ...>
email
>used to create an email textbox, where the user can enter a
valid email id only.
>it displays an error message automatically (built-in validation),
if the user enters other than email id (should contain @ and .).
Syn: <input type="email" attributes>
url
>used to create an url box, where the user can enter a valid url
for downloading files or playing videos.
>it displays an error message automatically (built-in validation),
if the user enters other than url.
Syn: <input type="url" attributes>
range
>used to create a slider bar, based on the specific range.
>this control req min value and max value, if we are not
specified then browser takes default values.
Syn: <input type="range" attributes>
attributes
min => it sets min value of slider
max => it sets max value of slider
step => it sets increment value
value => sets indicator init position
appearance: slider-vertical;
search
> used to create a search box, where the user can enter some
search text, it also displays a clear button to clear the text inside
the search box.
Syn: <input type="search" ... >
list box
>using the "select" tag we can create a list box.
>list box is used to display some options/items to the user and
allows the user to select any one of them (by default).
> "option" sub tag of "select" tag.
> "option" tag used to create/to add items/options to the list
box.
> "size" attribute used to change DDB into List box.
Syn:<select size="N" attributes>
<option attributes> Text </option>
<option> Text </option>
<option> Text </option>
...
</select>
Note: by default DDB is displaying 1st added option
attributes:
selected : this attribute of "option" tag, used to change
default selected option/item of DDB
multiple :it allows user to select more than one option @time
size :attribute used to change DDB into List box and no.of
options to display @time
option groups
> "optgroup" tag is used to group-up some options/items inside
the "select" tag.
> one "select" tag can contain many "optgroup" tags, the
"optgroup" tag contains many "options".
>its paired tag
> "optgroup" tag is the sub tag of "select" tag.
Syn:
<select>
<optgroup label="Text">
<option> .. </option>
<option> .. </option>
<option> .. </option>
</optgroup>
<optgroup>
...
</optgroup>
</select>
textarea
>"textarea" tag is used to create a multi-line textbox.
use case: comments, address, feedback, delivery instr, ...
>its paired tag
>it creates a multi-line text box, with default sizes. (2row & 20
col)
Syn: <textarea attributes>
init value
</textarea>
attributes:
rows : it rep no.of lines to display @time, if more lines of data
entered
automatically scrollbar is activated.
cols : it rep no.of chars per line
maxlength : it rep total no.of chars allowed in textbox.
Note: user can resize the textarea, at runtime in the browser.
progress bar
> "progress" tag is used to display the progress of a task.
> to move progress bar dynamically, we have to use "JS"
> it is a paired tag.
SYn: <progress attributes> </progress>
attributes:
min max value
label
> when the user clicks on the label, the cursor will appear in the
associated control automatically.
Note: labels are not sent to the server while submitting the
form.
HTML5 tags
output tag
Syn:
<details>
<summary>Text</summary>
information
</details>
header
Syn: <header>
</header>
nav
Syn: <nav>
</nav>
section
Syn: <section>
footer
>"footer" tag represents the footer part of the web page, which
may include information of contact, faqs, location, copyrights,
etc...
Syn: <footer>
</footer>
aside
</aside>
Audio tag
Syn:-
OR
<audio attributes>
</audio>
Attribute Definition
loop Repeat the audio file from the beginning after its
completion.
Video tag
Syn:-
OR
<video attributes>
...
</video>
Attribute Definition
completion.
iframe
<iframe attributes>
</iframe>
att:
width =>
height =>
map tag
> map tag used to explore internal details about par area of img
Syn:
<img src="image">
<map name="">
...
</map>
> circle
> rect
> poly
https://www.image-map.net/
marquee tag
Syn:
attributes:
scrollamount => 6
> RWD