When users visit your website, they do things like click various links, bring mouse over text and images etc. These are examples of what we call events in JavaScript and VBScript terminologies. We can write our event handlers using JavaScript or VBScript and can specify some actions to be taken against these events. Though these are the events but they will be specified as attributes for the HTML tags. The HTML 4.01 specification had defined 19 events but later HTML-5 has added many other events which we have listed down here −
Window Events Attributes
Following events have been introduced in older versions of HTML but all the tags marked with are part of HTML-5.
Events | HTML-5 | Description |
---|---|---|
onafterprint | ![]() | Triggers after a document is printed |
onbeforeprint | ![]() | Triggers before a document is printed |
onbeforeonload | ![]() | Triggers before a document loads |
onerror | ![]() | Triggers when an error occurs |
onhaschange | ![]() | Triggers when a document has changed |
onload | Triggers when a document loads | |
onmessage | ![]() | Triggers when a message is triggered |
onoffline | ![]() | Triggers when a document goes offline |
ononline | ![]() | Triggers when a document comes online |
onpagehide | ![]() | Triggers when a window is hidden |
onpageshow | ![]() | Triggers when a window becomes visible |
onpopstate | ![]() | Triggers when a window’s history changes |
onredo | ![]() | Triggers when a document performs a redo |
onresize | ![]() | Triggers when a window is resized |
onstorage | ![]() | Triggers when a document loads |
onundo | ![]() | Triggers when a document performs an undo |
onunload | Triggers when a user leaves the document |
Form Events
Following tags have been introduced in older versions of HTML but all the tags marked with are part of HTML-5.
Events | HTML-5 | Description |
---|---|---|
onblur | Triggers when a window loses focus | |
onchange | Triggers when an element changes | |
oncontextmenu | ![]() | Triggers when a context menu is triggered |
onfocus | Triggers when a window gets focus | |
onformchange | ![]() | Triggers when a form changes |
onforminput | ![]() | Triggers when a form gets user input |
oninput | ![]() | Triggers when an element gets user input |
oninvalid | ![]() | Triggers when an element is invalid |
onreset | Triggers when a form is reset | |
onselect | Triggers when an element is selected | |
onsubmit | Triggers when a form is submitted |
Keyboard Events
Events | HTML-5 | Description |
---|---|---|
onkeydown | Triggers when a key is pressed | |
onkeypress | Triggers when a key is pressed and released | |
onkeyup | Triggers when a key is released |
Mouse Events
Following tags have been introduced in older versions of HTML but all the tags marked with are part of HTML-5.
Events | HTML-5 | Description |
---|---|---|
onclick | Triggers on a mouse click | |
ondblclick | Triggers on a mouse double-click | |
ondrag | ![]() | Triggers when an element is dragged |
ondragend | ![]() | Triggers at the end of a drag operation |
ondragenter | ![]() | Triggers when an element has been dragged to a valid drop target |
ondragleave | ![]() | Triggers when an element leaves a valid drop target |
ondragover | ![]() | Triggers when an element is being dragged over a valid drop target |
ondragstart | ![]() | Triggers at the start of a drag operation |
ondrop | ![]() | Triggers when a dragged element is being dropped |
onmousedown | Triggers when a mouse button is pressed | |
onmousemove | Triggers when the mouse pointer moves | |
onmouseout | Triggers when the mouse pointer moves out of an element | |
onmouseover | Triggers when the mouse pointer moves over an element | |
onmouseup | Triggers when a mouse button is released | |
onmousewheel | ![]() | Triggers when the mouse wheel is being rotated |
onscroll | ![]() | Triggers when an element’s scrollbar is being scrolled |
Media Events
Following tags have been introduced in older versions of HTML but all the tags marked with are part of HTML-5.
Events | HTML-5 | Description |
---|---|---|
onabort | Triggers on an abort event | |
oncanplay | ![]() | Triggers when a media can start play, but might has to stop for buffering |
oncanplaythrough | ![]() | Triggers when a media can be played to the end, without stopping for buffering |
ondurationchange | ![]() | Triggers when the length of a media is changed |
onemptied | ![]() | Triggers when a media resource element suddenly becomes empty. |
onended | ![]() | Triggers when a media has reached the end |
onerror | ![]() | Triggers when an error occurs |
onloadeddata | ![]() | Triggers when media data is loaded |
onloadedmetadata | ![]() | Triggers when the duration and other media data of a media element is loaded |
onloadstart | ![]() | Triggers when the browser starts loading the media data |
onpause | ![]() | Triggers when media data is paused |
onplay | ![]() | Triggers when media data is going to start playing |
onplaying | ![]() | Triggers when media data has started playing |
onprogress | ![]() | Triggers when the browser is fetching the media data |
onratechange | ![]() | Triggers when the playing rate of media data has changed |
onreadystatechange | ![]() | Triggers when the ready-state changes |
onseeked | ![]() | Triggers when the seeking attribute of a media element is no longer true, and the seeking has ended |
onseeking | ![]() | Triggers when the seeking attribute of a media element is true, and the seeking has begun |
onstalled | ![]() | Triggers when there is an error in fetching media data |
onsuspend | ![]() | Triggers when the browser has been fetching media data, but stopped before the entire media file was fetched |
ontimeupdate | ![]() | Triggers when media changes its playing position |
onvolumechange | ![]() | Triggers when a media changes the volume, also when volume is set to “mute” |
onwaiting | ![]() | Triggers when media has stopped playing, but is expected to resume |
HTML Event Attributes Complete Reference
Events are actions that happen in the browser when the user does something For example when users click on the mouse or type something on the keyboard. Event Attributes: In HTML, we can use event actions on the browser, and with the help of event, the user responds to the system. Event Attributes can be used with HTML elements to perform various actions.
HTML – Fonts Reference
Fonts are specific to platform. You will have different look and feel of a web page on different machines running different operating systems like Windows, Linux or Mac iOS. Here we are giving a list of fonts which are available in various operating systems. HTML <font> tag is deprecated in version 4.0 onwards and now all fonts are set by using CSS. Here is the simple syntax of setting font of a body of web page.
body {
font-family: "new century schoolbook";
}
or
<body style = "font-family:new century schoolbook;">
Example
<!DOCTYPE html> <html> <head> <title>Font Setting Using CSS</title> </head> <body> <p>Change any of the style and try it.</p> <div style = "font-family:verdana;">This is demo for font family</div> <br /> <div style = "font-size:120%;">This is demo for font size</div> <br /> <div style = "font-size:14pt;">This is demo for font size</div> </body> </html>
OUTPUT
Change any of the style and try it.
This is demo for font family
This is demo for font size
This is demo for font size
Fonts for Microsoft Systems
Font | Font | Font |
---|---|---|
Andale Mono | Arial | Arial Bold |
Arial Italic | Arial Bold Italic | Arial Black |
Comic Sans MS | Comic Sans MS Bold | Courier New |
Courier New Bold | Courier New Italic | Courier New Bold Italic |
Georgia | Georgia Bold | Georgia Italic |
Georgia Bold Italic | Impact | Lucida Console |
Lucida Sans Unicode | Marlett | Minion Web |
Symbol | Times New Roman | Times New Roman Bold |
Times New Roman Italic | Times New Roman Bold Italic | Tahoma |
Trebuchet MS | Trebuchet MS Bold | Trebuchet MS Italic |
Trebuchet MS Bold Italic | Verdana | Verdana Bold |
Verdana Italic | Verdana Bold Italic | Webdings |
Fonts for Macintosh Systems
Following is the list of fonts supported by Macintosh System 7 and higher versions
Font | Font | Font |
---|---|---|
American Typewriter | Andale Mono | Apple Chancery |
Arial | Arial Black | Brush Script |
Baskerville | Big Caslon | Comic Sans MS |
Copperplate | Courier New | Gill Sans |
Futura | Herculanum | Impact |
Lucida Grande | Marker Felt | Optima |
Trebuchet MS | Verdana | Webdings |
Palatino | Symbol | Times |
Osaka | Papyrus | Times New Roman |
Textile | Zapf Dingbats | Zapfino |
Techno | Hoefler Text | Skia |
Hoefler Text Ornaments | Capitals | Charcoal |
Gadget | Sand |
You can check example fonts here − Mac Fonts Examples
Fonts for Unix Systems
Following is the list of fonts supported by most Unix System variants
Font | Font | Font |
---|---|---|
Charter | Clean | Courier |
Fixed | Helvetica | Lucida |
Lucida bright | Lucida Typewriter | New Century Schoolbook |
Symbol | Terminal | Times |
Utopia |
HTML ASCII Codes
There are 27 = 128 printable characters which can be represented by different 7-BIT ASCII codes. Another set of characters are not for HTML representation but they are devised to control hardware. Following tables list down all the 7-BIT ASCII codes and their equivalent HTML Entity Codes. If you want to see equivalent HEX, OCT and extended set of ASCII codes then check next chapter.
7-BIT Printable ASCII Characters
ASCII Characters | Description | HTML Entity Codes |
---|---|---|
space |   | |
! | exclamation mark | ! |
“ | quotation mark | " |
# | number sign | # |
$ | dollar sign | $ |
% | percent sign | % |
& | ampersand | & |
‘ | apostrophe | ' |
( | left parenthesis | ( |
) | right parenthesis | ) |
* | asterisk | * |
+ | plus sign | + |
, | comma | , |
– | hyphen | - |
. | period | . |
/ | slash | / |
0 | digit 0 | 0 |
1 | digit 1 | 1 |
2 | digit 2 | 2 |
3 | digit 3 | 3 |
4 | digit 4 | 4 |
5 | digit 5 | 5 |
6 | digit 6 | 6 |
7 | digit 7 | 7 |
8 | digit 8 | 8 |
9 | digit 9 | 9 |
: | colon | : |
; | semicolon | ; |
< | less-than | < |
= | equals-to | = |
> | greater-than | > |
? | question mark | ? |
@ | at sign | @ |
A | uppercase A | A |
B | uppercase B | B |
C | uppercase C | C |
D | uppercase D | D |
E | uppercase E | E |
F | uppercase F | F |
G | uppercase G | G |
H | uppercase H | H |
I | uppercase I | I |
J | uppercase J | J |
K | uppercase K | K |
L | uppercase L | L |
M | uppercase M | M |
N | uppercase N | N |
O | uppercase O | O |
P | uppercase P | P |
Q | uppercase Q | Q |
R | uppercase R | R |
S | uppercase S | S |
T | uppercase T | T |
U | uppercase U | U |
V | uppercase V | V |
W | uppercase W | W |
X | uppercase X | X |
Y | uppercase Y | Y |
Z | uppercase Z | Z |
[ | left square bracket | [ |
\ | backslash | \ |
] | right square bracket | ] |
^ | caret | ^ |
_ | underscore | _ |
` | grave accent | ` |
a | lowercase a | a |
b | lowercase b | b |
c | lowercase c | c |
d | lowercase d | d |
e | lowercase e | e |
f | lowercase f | f |
g | lowercase g | g |
h | lowercase h | h |
i | lowercase i | i |
j | lowercase j | j |
k | lowercase k | k |
l | lowercase l | l |
m | lowercase m | m |
n | lowercase n | n |
o | lowercase o | o |
p | lowercase p | p |
q | lowercase q | q |
r | lowercase r | r |
s | lowercase s | s |
t | lowercase t | t |
u | lowercase u | u |
v | lowercase v | v |
w | lowercase w | w |
x | lowercase x | x |
y | lowercase y | y |
z | lowercase z | z |
{ | left curly brace | { |
| | vertical bar | | |
} | right curly brace | } |
~ | tilde | ~ |
7-BIT ASCII Device Control Characters
ASCII Characters | Description | HTML Entity Codes |
---|---|---|
NUL | null character | � |
SOH | start of header |  |
STX | start of text |  |
ETX | end of text |  |
EOT | end of transmission |  |
ENQ | enquiry |  |
ACK | acknowledge |  |
BEL | bell (ring) |  |
BS | backspace |  |
HT | horizontal tab | 	 |
LF | line feed | |
VT | vertical tab |  |
FF | form feed |  |
CR | carriage return | |
SO | shift out |  |
SI | shift in |  |
DLE | data link escape |  |
DC1 | device control 1 |  |
DC2 | device control 2 |  |
DC3 | device control 3 |  |
DC4 | device control 4 |  |
NAK | negative acknowledge |  |
SYN | synchronize |  |
ETB | end transmission block |  |
CAN | cancel |  |
EM | end of medium |  |
SUB | substitute |  |
ESC | escape |  |
FS | file separator |  |
GS | group separator |  |
RS | record separator |  |
US | unit separator |  |
DEL | delete (rubout) |  |