html5 Updated 15-2-17-1-1
html5 Updated 15-2-17-1-1
The multiple attribute works with the following input types: email, and file.
The <keygen> tag specifies a key-pair generator field used for forms.When the
form is submitted, the private key is stored locally, and the public key is sent to
the server.
Q. The _________ is used for input fields that should contain a telephone
number.
Ans. <input type="tel">
q) createLinearGradient()
<!DOCTYPE>
q) canvas tag
q) <embed tag>
q) <video> tag
q) <audio > tag
Form Tag
Tag Description
<details> Defines additional details that the user can view or hide
Attribute Description
spellcheck Specifies whether the element is to have its spelling and gramm
onhashchange script Script to be run when there has been changes to the anchor p
onoffline script Script to be run when the browser starts to work offline
ononline script Script to be run when the browser starts to work online
onpagehide script Script to be run when a user navigates away from a page
onunload script Fires once a page has unloaded (or the browser window has b
Form Events
Events triggered by actions inside a HTML form (applies to almost all HTML
elements, but is most used in form elements):
onblur script Fires the moment that the element loses focus
onchange script Fires the moment when the value of the element is changed
onsearch script Fires when the user writes something in a search field (for <in
onselect script Fires after some text has been selected in an element
Keyboard Events
Mouse Events
onmousemove script Fires when the mouse pointer is moving while it is over an ele
onmouseout script Fires when the mouse pointer moves out of an element
onmouseover script Fires when the mouse pointer moves over an element
onmouseup script Fires when a mouse button is released over an element
onwheel script Fires when the mouse wheel rolls up or down over an element
Drag Events
ondragenter script Script to be run when an element has been dragged to a valid
ondragleave script Script to be run when an element leaves a valid drop target
ondragover script Script to be run when an element is being dragged over a vali
ondragstart script Script to be run at the start of a drag operation
Clipboard Events
oncopy script Fires when the user copies the content of an element
oncut script Fires when the user cuts the content of an element
onpaste script Fires when the user pastes some content in an element
Media Events
Events triggered by medias like videos, images and audio (applies to all HTML
elements, but is most common in media elements, like <audio>, <embed>,
<img>, <object>, and <video>).
Tip: Look at our HTML Audio and Video DOM Reference for more information.
Attribute Value Description
oncanplay script Script to be run when a file is ready to start playing (when
to begin)
oncanplaythrough script Script to be run when a file can be played all the way to the
for buffering
oncuechange script Script to be run when the cue changes in a <track> elemen
ondurationchange script Script to be run when the length of the media changes
onemptied script Script to be run when something bad happens and the file i
(like unexpectedly disconnects)
onended script Script to be run when the media has reach the end (a usefu
like "thanks for listening")
onerror script Script to be run when an error occurs when the file is being
onloadstart script Script to be run just as the file begins to load before anythi
onpause script Script to be run when the media is paused either by the use
onplay script Script to be run when the media is ready to start playing
onplaying script Script to be run when the media actually has started playin
onprogress script Script to be run when the browser is in the process of gettin
onratechange script Script to be run each time the playback rate changes (like w
to a slow motion or fast forward mode)
onseeked script Script to be run when the seeking attribute is set to false in
has ended
onseeking script Script to be run when the seeking attribute is set to true in
active
onstalled script Script to be run when the browser is unable to fetch the me
reason
onsuspend script Script to be run when fetching the media data is stopped be
loaded for whatever reason
ontimeupdate script Script to be run when the playing position has changed (lik
forwards to a different point in the media)
onvolumechange script Script to be run each time the volume is changed which (in
volume to "mute")
onwaiting script Script to be run when the media has paused but is expecte
the media pauses to buffer more data)
Misc Events
ontoggle script Fires when the user opens or closes the <details> element
Canvas Examples. A canvas is a rectangular area on an HTML page. By default, a canvas has
no border and no content. The markup looks like this:
HTML 4.9
HTML 4
HTML 4.01
HTML 4.1
<!DOCTYPE HTML5>
<!DOCTYPE html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN"
"http://www.w3.org/TR/html5/strict.dtd">
3. Which HTML5 element is used to specify a footer for a document or section?
<footer>
<bottom>
<section>
<ins>
<font>
<menu>
<q>
<abbr>
<acronym>
<cite>
<base>
HTML elements
Style attributes
Event attributes
<movie>
<video>
<media>
<audio>
<sound>
<mp3>
href
src
rel
type
10. In HTML5, which method is used to get the current location of a user?
getPosition()
getCurrentPosition()
getUserPosition()
Return the position of the first found occurrence of content inside a string
Specify whether the content of an element should be editable or not
Update content from the server
Specifies a context menu for an element. The menu appears when a user right-clicks on the
element
HTML attributes
HTML elements
Event attributes
Style attributes
13. In HTML5, you can embed SVG elements directly into an HTML page.
False
True
HTML
CSS
XML
getContent
getContext
getCanvas
getGraphics
17. In HTML5, which attribute is used to specify that an input field must be filled out?
required
validate
placeholder
formvalidate
controls
slider
range
search
19. Which input type defines a week and year control (no time zone)?
date
year
week
20. Which HTML5 element is used to display a scalar measurement within a known range?
<measure>
<range>
<gauge>
<meter>
<navigate>
<navigation>
<nav>
False
True
24. Which HTML5 element is used to specify a header for a document or section?
<top>
<section>
<header>
<head>
<content>
<header>
<section>
<article>
Total 25 questions