Professional Documents
Culture Documents
Site Evaluation
This unit will give you a basic understanding of the core design principles that apply to web
design and development. The purpose of this lesson is to begin considering what makes a high-quality
website.
To begin, it is important for us to understand that there are millions of websites in the web. Aside
from determining what good design is, it is important that users know how to distinguish websites that
present accurate and factual data over those that do not. This inspired many institutions to create their
own web evaluation criteria.
In this unit, we will be using framework for evaluating a Quality Website created by Hasan and
Abuelrub (2011) in their article, assessing a Quality Website published in ScienceDirect in order to
evaluate websites. This framework is the end result of their assessment of the different web evaluation
tools used to evaluate website and e-business sites.
The Framework for Evaluating a Quality Website categorized the different criteria into four
which is composed of the following: Content, Design, Organization and User-Friendliness as shown in
Figure 1.1 Hierarchy of Criteria for Website Evaluation
Website Quality
Indicator Checklist
Timeliness Information is up to date
Website is frequently updated
Date of late update is indicated
Relevance Organization’s Objectives are displayed
Organization’s history is indicated
The target audience can be distinguished
Products/Services are indicated
Photographs of the organization’s facilities and
offices are displayed
Multilanguage / Culture User can choose language or website has different
language versions or website can be translated to
another language
Website respect different culture
Variety of Presentation -Website has different forms of content aside from
text such as photos, graphics, animations, video,
audio, etc.
Accuracy Information Presented is precise
There are no spelling and grammar error
Sources of information are identified and
acknowledged
Objectiveness Information presented is unbiased
Authority Organization’s physical address is in the website
Site sponsors are visible
Webmaster/site manager are indicated including
their contact details
Copyright indicated
2. Design Quality – This dimension is concerned with the visual characteristics of websites
design that attract the users and encourage them to stay longer viewing the website and reenter it. Table
1.2 shows the indicators and checklist on how to achieve design quality in a website.
Table 1.2
Indicators Checklist
Attractiveness Innovate design
Aesthetic effect is incorporated
Emotional appeal
Appropriateness Design appropriate to the type of website
Image used are relative to the theme/topic
Images, colors and text are balanced
Color Background color highlights the contents and is
appropriate with the text color
Text color is appropriate and readable
Combination of the text and background color
considered web Accessibility Standards
Colors should be under the recommended Web-
Safe palette
Image / Sound / Video The Number of images, sound clips and video
clips is appropriate
These are appropriate and does not distract the
reader from the text and the message the page is
imparting
Images, sound clips and video clips used should
be compressed to lessen the bandwidth
Provide alternate text for images and captions for
videos
Text Text types and styles should be consistent
Text should be readable
Size should be relative
Avoid using all caps
There should be breathing space/white space
between the content
There are headings and sub heading to emphasize
content
Scrolling text should be used appropriately and
sparingly
Sequential appearance of text then images
3. Organization – This dimension is concerned with the logical grouping, categorization, or
structure of websites elements in order to help the user reach the required information quickly, navigate
easily within the website, feel comfortable within its layout consistency, and keep him informed that he is
still in the same website. Table 1.3 contains the indicators and the checklist in order to determine if a
website is organized
Table 1.3 Indicators and check elements of the organization quality dimension
4.User-Friendliness – it is concerned with many issues that help any user regardless of his
education or experience to find the needed information within a reasonable time, the capability of the
website to maintain specific level of performance when used, and interactivity or connectivity which
emphasizes the existence of interaction between user and website using different tools. Table 1.4 List the
indicators and checklist to determine if a website is user friendly.
Table 1.4 Indicators and Check Elements of the user-friendliness quality dimension
This list does not present all accessibility issues, but by addressing this basic principles, you will ensure
greater accessibility of your web content to everyone. You can learn more accessibility by browsing our
articles and resources.
a. Using Notepad ++
To open notepad ++, Click Start -> Programs -> Notepad++
Or
Start -> Run. Type the word NOTEPAD++ in the text as shown in the Figure 1.6. Click OK
button
HTML Tags
General Guidelines
Based from the guidelines release by smart (2014), there are some several guidelines you need to
remember about HTML. This are the following:
There are two types of tags: There are containers such as <html> and </html> which are
switched ON and OFF (as indicate by the /), and there are separators such as <br>. Remember to
close all container tags.
Always include comments explaining your code. Your code must be clearly comprehensive to
other coders for ease of maintenance. HTML comments are within a <!—and a --> .
HTML Tags are not case sensitive. <U> means <u>. However, the WORLD WIDE WEB
CONSORTIUM (W3C) recommend lowercase tags in their HTML 4 recommendation. Aside from
this, XHTML, considered as a next generation HTML, requires lowercase tags.
Excess white space (including spaces, newlines, tabs, courage returns, etc.) in HTML is generally
ignored. Therefor, the use of extra white space in you code is encourage in order improve
readability, without impacting on the result displayed.
Use <meta> tags. The <meta> tag, contained within <head> and </head> tag is not necessary,
however it is good programming practice to use it. Meta tags can be very useful for Web
developers. They can be used to identify the creator of the page, what HTML specifications the
page follows, and the keywords and the description of the page.
o Make sure to fill the keyword and description attributes. These allow the search engines
to easily index your page using keywords you specify and a description of the site that
you write. The keyword attribute specify to the search engines if the website shall be
displayed if the keyword values in the meta tag match those that were entered in the
search box.
Example:
<meta name = “keywords” content = “webpage design and development, web design,
WebDes1, Web Development”>
Tag Attribute
Tag can either be basic or it could have attributes. Two examples of tags that do not have any
attributes are:
o <i> - for italic
o <b> - for bold
But for tags with attributes, these provide additional information about the HTML elements on
your page.
o For example, the tag:
o <body>
It defines the body element of your HTML page. With the bgcolor attribute, you can set the
background color of your page. The code below sets the background color to blue:
o <body bgcolor=”blue”>
o Another example is
o <table>
This tag defines a HTML table. With an added border attribute, you can show or hide the table
border:
o <table border=”0”>
Attribute values should always be enclosed in quotes. Double style quotes are the most
common, but single style quotes are also allowed.
In some rare situation, like when the attribute value it self contain quotes, it is necessary to use
single quotes:
For our HTML documents to be consistent and since browsers do not handle single quotes
properly, we will be using double quotes for the values of our tags attributes.
The most important tags in HTML are tags that defines heading, paragraph and line breaks.
A. Headings
Headings are define with the <h1> to <h6> tags. <h1> Defines the largest heading. <h6>
defines the smallest heading.
The following HTML code below will display sample headings in the web browser as illustrated
and Figure 1.14
Code:
Output:
The following are the different HTML tags as categorized and described in w3schools.
A. Basic Tags
The tags in table 1.5 are used to create an HTML file and to define the major parts of the HTML
page.
Tag Description
<!DOCTYPE> Defines the document type.
E.G. <!DOCTYPE html> defines that the document
is an HTML document
<html> Defines an HTML Document
<title> Defines an HTML Document
<body> Defines the document’s body
<h1> to <h6> Defines HTML headings
<p> Defines a paragraph
<br> Inserts a single line break
<hr> Defines a thematic change in the content
<!-- --> Defines a comment
B. Formatting Tags
The following formatting tags in Table 1.6 are used to enhance the appearance of text and to
emphasize content in page.
Tag Description
<abbr> Defines an abbreviation
<address> Defines contact information for the author/owner of a
documentary article
<b> Defines bold text
<bdo> Overrides the current text direction
<blockquote> Defines a section that quoted from source
<cite> Defines the title of a work
<code> Defines a piece of computer code
<del> Defines text that has been deleted from a document
<em> Defines emphasize text
<i> Defines a part of text in an alternate voice or mood
<ins> Defines a text that has been inserted into a document
<kbd> Defines keyboard input
<mark> Defines marked/highlighted text
<meter> Defines a scalar measurement within a known range (a gauge)
<pre> Defines a preformatted text
<progress> Represents the progress of a task
<q> Defines short quotation
<small> Defines smaller text
<strong> Defines important text
<sub> Defines subscripted text
<sup> Defines superscripted text
<time> Defines a date/time
C. Forms and Input Tags
HTML forms allow interactions between a website application and a user through the
following input elements represented by the following tags in Table 1.17. Further discussion of
HTML forms and input cam be found in Lesson 9.
Tag Description
<form> Defines an HTML form for user input
<input> Defines and input control
<textarea> Defines multiline input control (text area)
<button> Defines a clickable button
<select> Defines a drop-down list
<optgroup> Defines a group of related options in a drop-down
list
<option> Defines an option in a drop-down list
<label> Defines a label for an <input> element
<fieldset> Groups related elements in a form
<legend> Defines a caption for a <fieldset> element
<datalist> Specifies a list of pre-defined options
<keygen> Defines a key-pair generator field (for forms)
<output> Defines the result of a calculation
D. Frames
Based on the specifications released by W3C, HTML frames allow authors to present
documents in multiple views, which may be independent windows or subwindows. Multiple
views offer designers a way to keep certain information visible, while other views are scrolled or
replaced. For example, within the same window, one frame might display a static banner, a
second a navigation menu, and a third the main document that can be scrolled through or
replaced by navigating in the second frame.
Tag Description
<iframe> Defines an inline frame
E. Images
Webpages become more interesting and appealing because of elements such as photos,
illustrations, games, among others which can be inserted in the document.
Table 1.9 show the tags associated to inserting images, canvas and maps. Further
discussion on how to use these tags can be found in lesson 10.
Tag Description
<img> Defines an image
<map> Defines a client-side image-map
<area> Defines an area inside an image-map
<canvas> Used to draw graphics, on the fly, via scripting
(usually JavaScript)
<figcaption> Defines a caption for a <figure> element
<figure> Specifies selt-contained content
F. Audio / Video
Aside from images and graphics, HTML allows insertion of multimedia such as video and
audio in a webpage through the tags found in Table 1.10. These tags do not store the media but
create links to the media as further discussed in Lesson 10.
Tags Description
<audio> Defines sound content
<source> Defines multiple media resources for media
elements (<video> and <audio>)
<track> Defines text tracks for media elements (<video>
and <audio>)
<video> Defines a video or movie
G. Links
Links are used in order to connect and link the different webpages and access external
webpages. The tags in order to do these can be found in Table 1.11. A detailed discussion on
using links can be found in lesson 8.
Tags Description
<a> Defines a hyperlink
<link> Defines the relationship between a document
and an external resource (most used to link to
style sheets)
<nav> Defines navigation links
H. Lists
HTML Lists are used to group related pieces of information together, so that they are
clearly associated with each other and easy to read. In modern web development lists are
frequently used for navigation as well as general content.
Lists are good from a structural point of view as they help create a well-structured, more
accessible, easy-to-maintain document. In addition, W3C (2014) identified the use of lists useful
for a purely practical reason which is allow extra elements to attach to CSS styles for a whole
variety of styling. HTML Lists tags are listed in Table 1.12.
Tag Description
<ul> Defines an unordered list
<ol> Defines an ordered list
<li> Defines a list item
<dl> Defines a description list
<dt> Defines a term/name in a description list
<dd> Defines a description of term/name in a
description list
<menu> Defines a list/menu of commands
<menuitem> Defines a command/menu item that user can
invoke from a popup menu
I. Tables
HTML tables are used to display data in tabular form. It was also popularly used before
to layout webpages before. Table 1.13 lists the HTML tags associated in creating tables, rows
and columns.
Table 1.13.HTML Table Tags
Tag Description
<table> Defines a table
<caption> Defines a table caption
<th> Defines a header in a table
<tr> Defines a row in a table
<td> Defines a cell in a table
<thead> Groups the header content in a table
<tbody> Groups the body content in a table
<tfoot> Groups the footer content in a table
<col> Specifies column properties for each column
within a <colgroup> element
<colgroup> Specifies a group of one or more columns in a
table for formatting
J. Styles and Semantics
One of the new HTML 5 tags that were created are semantic tags. These semantic
elements were made to clearly define different parts of a web page such as header, footer,
section, etc. Table 1.14 shows the HTML tags to create styles and semantics in a webpage.
Tag Description
<style> Defines style information for a document
<div> Defines a section in a document
<span> Defines a section in a document
<header> Defines a header for a document or section
<footer> Defines a footer for a document or section
<section> Defines a section in a document
<article> Defines an article
<aside> Defines content aside from the page content
<details> Defines additional details that user can view or hide
<dialog> Defines a dialog box or window
<summary> Defines a visible heading for a <details> element
K. Meta Info
These tags are used to provide metadata about the HTML document. Metadata is
data/information about the data or in Web Design, Information about the website.
According to W3Schools (2014), metadata will not be displayed on the page, but will be
machine parsable – meaning, it can be understood and executed by the browser to display the
content/reload page, search engines and other Web services.
Meta elements are typically used to specify page description, keywords, and author of
the document, last modified, and other metadata. These meta tags are listed in Table 1.15.
Table 1.15a. HTML Meta Info Tags
Tag Description
<head> Defines information about the document
<meta> Defines metadata about an HTML document
<base> Specifies the base URL/target for all relative URLs
in a document
Table 1.15b. HTML Meta Attributes
L. Programming
In order to insert scripts such as JavaScript or embed an object such as video in your
HTML document, use HTML programming tags to do these as listed in Table 1.16.
I. Unordered Lists
Unordered lists are used to create a listing of items that do not have a required order.
These are also called bulleted lists.
An unordered list starts with the <ul> tag. Each list item starts with <li> tag.
The list items are marked with bullets (typically small black circles) as the default tag but
this can be replaced with a square or a circle. Table 1.17 shows the listing of attribute that
can be used to create “bullets” in unordered lists.
Output:
II. Ordered Lists
An order list is used to create a list of items that are arranged in a particular sequence.
This is created using the OL element whose attributes and possible values are shown in
Table 1.18.
Code:
Output:
Output:
A <table> is an HTML structure for creating rows and columns. It is used for lists, specifications
and other tabular data as well as to locate elements on the page.
The table command gives the HTML designer reasonably precise control over placement of text
and images. HTML tables are built using the <table> tag define the overall table and then table row <tr>
tag to build each row. The tags are listed in Table 1.12 in Lesson 5 where:
Just like other HTML tags, tables have their own attributes in order for it to be formatted. These
attributes are listed in Table 1.19.
Code:
Output:
By setting the attribute border in the table tag to “1px” (one pixel), the table’s borders are now
visible as shown in Figure 1.19.
Code:
Output:
Hyperlinks
A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another
document. A link, or an anchor, is a word, a group of words or an image you can click to jump to another
document or a specific part of the current document. The element for links, both internal and external is
as simple as <a>.
I. HTML Link
The <a> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <a> element is the href attribute, which
indicates the link’s destination.
By default, links will appear as follows in all browsers:
o An unvisited link is underline and blue
o A visited link is underlined and purple
o An active link is underlined and red
The HTML code for a link is simple. It looks like this:
<a href=”url”>Link text</a>
The href attribute specifies the destination of link.
b. Document-Relative Links:
Document-relative links use direction form the source page to the destination page, sort of
like saying “Start here then follow this path until you reach the destination”.
There are three ways to do this – the method used will depend on the location of the
source and destination pages in relation to each other. We will use the example on the Figure
1.21 and create hyperlinks from the page called sourcepage.html to other pages in the site.
The following link means “Go up one directory level, then go to folder called directory3, then to
a file called page3.html”:
You can repeat the ../ to make the link more than one level higher, for example, “Go up
two levels, to a file called index.html”;
Important Note: For relative links to work, you must keep the file structure intact. For example,
if you moved the sourcepage.html file down into the directory2 folder, the relative links would
no longer work. In this case you would need to add another ../ to point the links to the correct
level. For example:
c. Site-Root-Relative Links
A Site-Root-Relative Link links pages on the same server or directory
The Site-Root-Relative Links use a single forward-slash / to signify the instruction: “Start at
the document root of the site ad go down the directory path from there.” The format is:
Despite the cumbersome name, this method is quite simple. The link begins at the same
level as your domain and works down from there. The link above is the same as:
This method has the significant advantage of staying intact if you move the source page.
The exact same link will work any page anywhere in the site.
Notes:
This method will not work on files on your own hard drive unless you run them
through a personal web server. However once you upload the pages to your server
they will work.
If your site does not have its own domain name, this method is likely to cause
problems. Consult your hosting provider for more information.
d. Internal Links
An internal hyperlink is a link which points to a particular part of a page. This can be useful
in long pages with lots of sub-section. For example, the links at the top of this page are internal
links pointing to each sub-heading.
Internal hyperlinks require an anchor tag with the “name” attribute like so:
Create an anchor like this at the place in the page you want to link to. It doesn’t matter if
there is anything between the open and close tags.
Then create a hyperlink which refers to this anchor with hash (#) like so:
This assumes that the name anchor is on the same page as the hyperlink. To link to anchor
on a separate destination page, simply create a normal link with the anchor name appended to
the file name like so:
e. Download Link
A Download Link links a file for the visitor to download
File links are used for allowing a visitor to download a file. These links are set up exactly
the same as the local or external links. Instead of “pointing” to another page or site, it points to
a file. When the user clicks on this link, the browser knows it is a file and will ask the visitor if
they want to download the file. The types of files available to be used for download depend on
your online server. A common and most accepted type is a ZIP file.
f. E-mail (mailto)
E-Mail Links, otherwise known as “mailto” links, use the following format:
This type of link is a special case, completely different to those described above. Instead of
linking to a place on the internet, clicking this link causes the user’s computer to open its default
email program (e.g. Outlook Express, Eudora, etc) and prepare a blank email to the specified
address. The user then enters their message and sends the email in the normal way.
If you want to be tricky, you can add a “subject” attribute to the link. This will
automatically insert the specified subject line into the email:
Output:
Links in the same directory as the current page have no path information listed
Filename
Sub-directories are listed without any preceding slashes
Weekly/filename
Links up one directory are listed as
../filename
b. Document-Relative Links
Output:
A form is a part of the HTML document that allows the page to collect any kind of information
from the user. It may also contain other form elements such as dropdown lists, radio buttons or
checkboxes.
The first thing to consider when developing forms is the information needed and how it should
be presented. Next, you have to ensure that the user can easily provide the information, which entails a
functional and visually appealing design.
Form Tag
A form tag is defined with the <form> tag, which tells the browser where the form starts and
ends. All kinds of HTML tags can then be added within the <form> tag.
Input Tag
Most of the form elements are defined with the <input> tag. The type of element is specified
through the type attribute.
Table 1.21 lists the common properties of form elements defined with the input tag:
Property Description
name Adds an internal name to the form element so the program that handles the form can
identify it.
id Defines a unique id for the element.
value Defines the default value or the caption of the form element.
title Defines a short description about the element that is usually shown as a “tool tip”
align Defines how the form element’s label is aligned. (TOP, MIDDLE, BOTTOM, RIGHT, LEFT,
TEXTTOP, BASELINE, ABSMIDDLE, ABSBOTTOM)
tabindex Defines the order that the form element is activated when the tab key is pressed.
In addition to the common properties of form elements, W3Schools (2014) also listed additional
HTML attributes for forms as show in Table 1.22
a. Text Field
It is used to define a one-line input field that a user can enter text info. Figure 1.25
shows an example of how to create a text field:
Code:
Output
b. Password Field
Password field are similar to text fields. The only difference is that the character entered
into a password fields shows up as dots on the screen. This is, of course, to prevent others from
reading the password on the screen.
Password field properties are the same as text field properties.
Code:
Output:
c. Radio Buttons
Radio buttons are used when a user is limited to selecting only one option form a set of
alternatives. The properties of radio buttons are the same as checkboxes
Figure 1.12 shows an example of how to create a radio button:
Code:
Output:
d. Checkboxes
Checkboxes are used when a user is allowed to select one or more options from a set of
alternatives.
Code:
Output:
e. Submit Button
Submit buttons send form data to a back-end process or application. The back-end
process when verifies and processes the data, eventually passing the information into some
database application.
The submit button has following attributes and their explanation as shown in Table 1.23.
Table 1.23 Submit Button and Attributes
HTML Explanation
submit Submit button
Name= Name of the button
Value= Text written on the button
Align= Alignment of the button
Tabindex= Tab order of the button
Figure 1.29 shows an example of how to create three types of submit button
Code:
Output:
Code:
Output:
Code:
Output:
Code:
Output:
i. Datetime-local
The input element with a type attribute whose value is “datetime-local” represents a control for
setting the element’s value to a string representing a local date and time (with no timezone
information). Figure 1.33 shows an example to define local date and time (no timezone).
Code:
Output:
Code:
And the resulting output:
k. Month
The input element with a type attribute whose value is “month” represents a control for
setting the element’s value to a string representing a month.
The month type allows the user to select a month and year. Figure 1.35 shows an
example defines a month and year control (no time zone):
Code:
Code:
Code:
And the resulting output:
o. Tel
The input element with a type attribute whose value is ”tel” represents a one-line plain-
text edit control for entering a telephone number.
Figure 1.69 shows an example define a field for entering a telephone number:
Code:
Code:
And the resulting output:
q. URL
The URL type is used for input fields that should contain a URL address. The value of the
URL field is automatically validated when the form is submitted.
Figure 1.41 shows an example defining a field for entering a URL:
Code:
Multimedia comes in many different formats. It can be almost anything you can hear or see like
text, pictures, music, sound, videos, records, films, animations, and more.
On the Internet you can often find multimedia elements embedded in web pages, and modern
web browsers have support for a number of multimedia formats.
Multimedia Formats
The most common way to discover the media type is look at the file extension. When a browser
sees the file extensions .htm or .html, it will assume that the file is an HTML page. The .xml extension
indicates an XML file, and the .css extension indicates a style sheet. Picture formats are recognized by
extensions like .gif and .jpg.
Multimedia elements also have their own file formats with different extensions like .swf,
.wmv, .mp3, and .mp4.
a. Image
In HTML, images are defined with the <img> tag.
The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for “source”. The
value of the src attribute is URL of the image you want to display.
Syntax:
To show images into an HTML document, try the code in Figure 1.43.
HTML defines a new element which specifies a standard way to embed a video/movie on a web
page: the <video> element and its attributes as shown in Table 1.24.
Tag Description
<video> Defines a video or movie
<source> Defines multiple media resources for media elements, such as <video>
and <audio>
<track> Define text tracks in mediaplayers
The 1.25 lists the different video formats, its file extension and description as defined by
W3CTutotial (2014) which can be used in your website.
Currently, there are 3 supported video formats for the <video> element: MP4, WebM, and Ogg
in HTML. Table 1.26 lists down the different videos and if these are supported by the different browsers.
To show a video in HTML5, insert the following code found in Figure 1.44 in your html code.
Code:
Output:
c. Audio
Most audio files are played through a plug-in (like Adobe Flash). However, different browsers
may have different plug-ins. According to W3Schools (2014) in pre-HTML, there was no standard to
allow audio to be played in webpage.
With HTML, a new element was defined which specifies a standard way to embed an audio file
on a web page. This is the <audio> element. Table 1.27 gives a listing of the tags associated in
incorporating audio in a website
Tag Description
<audio> Defines sound content
<source> Defines multiple media resources for media elements, such as <video> and
<audio>
At present, there are 3 supported file formats for the <audio> element. These are listed in Table
1.28 including their MIME type.
*MIME stands for Multi-Purpose Internet Mail Extensions and it is a standard way of classifying
file types on the Internet. Internet programs such as Web server and browsers all have a list of MIME
types, so that they can transfer files of the same type in the same way, no matter what operating system
they are working in. (Business Internet, 2014).
Format MIME-type
MP3 Audio/mpeg
Ogg Audio/ogg
Wav Audio/wav
These audio formats can be supported or not by browsers. Table 1.29 lists an evaluation of the
different browsers and if they can support these audio files.
Figure 1.45 shows an example showing how to insert an audio file in an HTML code.
Code:
Output:
HTML came up with audio/video methods, properties and events for the <audio> and <video>
elements for these to be manipulated in JavaScript. Tables 1.30, 1.31 and 1.32 lists these methods,
properties and events.
Method Description
addTextTrack() Adds a new text track to the audio/video
canPlayType() Checks if the browser can play the specified audio/video type
load() Re-loads the audio/video element
play() Starts playing the audio/video
pause() Pauses the currently playing audio/video
Property Description
audioTracks Return an AudioTrackList object representing available audio tracks
autoplay Sets or returns if the audio/video should start playing as soon as it is loaded
buffered Returns a TimeRanges object representing the buffered parts of the
audio/video
controller Returns the MediaController object representing the current media
controller of the audio/video
controls Sets or returns if the audio/video should display controls (like play/pause
etc.)
crossOrigin Sets or returns the CORS setting of the audio/video
currentSrc Returns the URL of the current audio/video
currentTime Sets or returns the current playback position in the audio/video (in seconds)
defaultMuted Sets or returns if the audio/video is muted by default
defaultPlaybackRate Sets or returns the default speed of the audio/video playback
duration Returns the length of the current audio/video (in seconds)
ended Returns if the playback of the audio/video had ended or not
error Returns a MediaError object representing the error state of the audio/video
loop Sets or returns if the audio/video should start over again when finished
mediaGroup Sets or returns if the audio/video belongs to (used to link multiple
audio/video elements)
muted Sets or returns if the audio/video is muted or not
networkState Returns the current network state of the audio/video
paused Sets or returns if the audio/video is paused or not
playbackRate Sets or returns the speed of the audio/video playback
played Returns a TimeRanges object representing the played parts of the
audio/video
preload Sets or returns if the audio/video should be loaded when the page loads
readyState Returns the current ready state of the audio/video
seekable Returns a TimeRanges object representing the seekable parts of the
audio/video
seeking Returns if the user is currently seeking in the audio/video
src Sets or returns the current source of the audio/video element
startDate Returns a Date object representing the current time offset
textTracks Returns a TextTrackList object representing the available text tracks
videoTracks Returns a VideoTrackList
volume Sets or returns the volume of the audio/video
Event Description
abort Fires when the loading of an audio/video is aborted
canplay Fires when the browser can start playing the audio/video
canplayrhrough Fires when the browser can play through the audio/video without stopping
for buffering
durationchange Fires when the duration of the audio/video is changed
emptied Fires when the current playlist is empty
ended Fires when the current playlist is ended
error Fires when an error occurred during the loading of an audio/video
loadeddata Fires when the browser has loaded the current frame of the audio/video
loadedmetadata Fires when the browser has loaded meta data for the audio/video
loadstart Fires when the browser starts looking for the audio/video
pause Fires when the audio/video has been paused
play Fires when the audio/video has been started or is no longer paused
playing Fires when the audio/video is ready to play after having been paused or
stopped for buffering
progress Fires when the browser is downloading the audio/video
ratechange Fires when the playing speed of the audio/video is changed
seeked Fires when the user is finished moving/skipping to a new position in the
audio/video
seeking Fires when the user starts moving/skipping to a new position in the
audio/video
stalled Fires when the browsers is trying to get media data, but data is not
available
suspend Fires when the browser is intentionally not getting media data
timeupdate Fires when the current playback position has changed
volumechange Fires when the volume has been changed
waiting Fires when the video stops because it needs to buffer the next frame
An example using these properties, methods and events for audio is shown in Figure 1.46
Output: