Home
HTML5 Tutorial (PDF Version)
Contents
1. lt defs gt lt radialGradient id gradient cx 50 cy 50 r 50 fx 503 fy 50S gt lt stop offset 0 style stop color rgb 200 200 200 stop opacity 0 gt lt stop offset 100 style stop color rgb 0 0 255 stop opacity 1 gt lt radialGradient gt lt defs gt elise CxS ALOOY CYNON rez ULOOY mya SO style fill url gradient gt lt svg gt lt body gt lt html gt This would produce following result in HTML5 enabled latest version of Firefox 16 Page _ Tutorials Point Simply Easy Learning TUTORIALS POINT HIMLS SVG Gradient Ellipse HTML5 WebSockets Web Sockets is a next generation bidirectional communication technology for web applications which operates over a single socket and is exposed via a JavaScript interface in HTML 5 compliant browsers Once you get a Web Socket connection with the web server you can send data from browser to server by calling a send method and receive data from server to browser by an onmessage event handler Following is the API which creates a new WebSocket object var SOCKS lc WaN CWS Oe ce item url ors Oe OS cle ee Here first argument url specifies the URL to which to connect The second attribute protocol is optional and if present specifies a sub protocol that the server must support for the connection to be successful WebSocket Attributes Following are the attribute of WebSocket object Assuming we created Sock
2. onmouseout onmouseover onmouseup onmousewheel onoffline onoine ononline onpagehide onpageshow onpause onplay onplaying onpopstate onprogress onratechange 8 Page script script script script script script script script script script script script script script script script script script script script script script script script script script script script script script script script script script Triggers when a media resource element suddenly becomes empty Triggers when media has reach the end Triggers when an error occur Triggers when the window gets focus Triggers when a form changes Triggers when a form gets user input Triggers when the document has change Triggers when an element gets user input Triggers when an element is invalid Triggers when a key is pressed Triggers when a key is pressed and released Triggers when a key is released Triggers when the document loads Triggers when media data is loaded Triggers when the duration and other media data of a media element is loaded Triggers when the browser starts to load the media data Triggers when the message is triggered Triggers when a mouse button is pressed Triggers when the mouse pointer moves Triggers when the mouse pointer moves out of an element Triggers when the mouse pointer moves over an element Triggers when a mouse button is released Triggers when the mouse wheel is being rotated Triggers when
3. gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt lt Olhy G OM Dp Oxemitss 710 10 300 20 170 50 Eilil Wrecis gt lt svg gt lt body gt lt html gt This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Polygon D HTML5 SVG Polyline Following is the HTML5 version of an SVG example which would draw a polyline using lt polyline gt tag 15 Page lt DOCTYPE html gt lt head gt lt title gt SVG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Polyline lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt polyline points 0 0 0 20 20 20 20 40 40 40 40 60 fill red gt lt svg gt lt body gt lt html gt This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Polyline A a y HTML5 SVG Gradients Following is the HTML5 version of an SVG example which would draw a ellipse using lt ellipse gt tag and would use lt radialGradient gt tag to define an SVG radial gradient Similar way you can use lt linearGradient gt tag to create SVG linear gradient LDOCE EEE mermi lt head gt lt title gt SVG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Gradient Ellipse lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt
4. gt HTML5 SVG Line lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt line x1 0 yl 0 x2 200 y2 100 style stroke red stroke width 2 gt lt svg gt lt body gt lt html gt You can use style attribute which allows you to set additional style information like stroke and fill colors width of the stroke etc This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Line HTML5 SVG Ellipse Following is the HTML5 version of an SVG example which would draw an ellipse using lt ellipse gt tag lt VIDIQICMENIEIE Jovicmmll gt lt head gt lt title gt SVG lt title gt 14 Page Fogi Por A Ne TUTORIALS PO SIMPLY EASY LEARNING lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Ellipse lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt sellipse c 100 Gye SOY ceSVIOOY mayer SOY sella gt lt svg gt lt body gt lt html gt This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Ellipse HTML5 SVG Polygon Following is the HTML5 version of an SVG example which would draw a polygon using lt polygon gt tag lt a CARP Bie inite melee lt head gt lt title gt SVG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Polygon lt h2
5. of the for attribute is a space separated list of IDs of other elements The placeholder attribute HTML5 introduced a new attribute called placeholder This attribute on lt input gt and lt textarea gt elements provides a hint to the user of what can be entered in the field The placeholder text must not contain carriage returns or line feeds Here is the simple syntax for placeholder attribute lt input type text name search placeholder search the web gt This attribute is supported by latest versions of Mozilla Safari and Crome browsers only 11 Page z Tutorials Point Simply Easy Learning TUTORIALS POINT The autofocus attribute This is a simple one step pattern easily programmed in JavaScript at the time of document load automatically focus one particular form field HTMLS introduced a new attribute called autofocus which would be used as follows lt input type text name search autofocus gt This attribute is supported by latest versions of Mozilla Safari and Crome browsers only The required attribute Now you do not need to have javascript for client side validations like empty text box would never be submitted because HTML5 introduced a new attribute called required which would be used as follows and would insist to have a value lt input type text name sSearch required gt This attribute is supported by latest versions of Mozilla Safari and Crome browsers only HTML5 SVG SVG st
6. script Triggers after the document is printed onbeforeonload script Triggers before the document loads onbeforeprint script Triggers before the document is printed onblur script Triggers when the window loses focus oncanplay script Triggers when media can start play but might has to stop for buffering oncanplaythrough script Triggers when media can be played to the end without stopping for buffering onchange script Triggers when an element changes onclick script Triggers on a mouse click oncontextmenu script Triggers when a context menu is triggered ondblclick script Triggers on a mouse double click ondrag script Triggers when an element is dragged ondragend script Triggers at the end of a drag operation ondragenter script Triggers when an element has been dragged to a valid drop target ondragleave script Triggers when an element leaves a valid drop target ondragover script Triggers when an element is being dragged over a valid drop target ondragstart script Triggers at the start of a drag operation ondrop script Triggers when dragged element is being dropped ondurationchange script Triggers when the length of the media is changed 7 Page e lt Tutorials Point Simply Easy Learning TUTORIALS POINT onemptied onended onerror onfocus onformchange onforminput onhaschange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmousemove
7. the document goes offline Triggers when the document comes online Triggers when the document comes online Triggers when the window is hidden Triggers when the window becomes visible Triggers when media data is paused Triggers when media data is going to start playing Triggers when media data has start playing Triggers when the window s history changes Triggers when the browser is fetching the media data Triggers when the media data s playing rate has changed Cc z Tutorials Point Simply Easy Learning TUTORIALS POINT onreadystatechange onredo onresize onscroll onseeked onseeking onselect onstalled onstorage onsubmit onsuspend ontimeupdate onundo onunload onvolumechange onwaiting script script script script script script script script script script script script script script script script HTMLS Web Forms 2 0 Triggers when the ready state changes Triggers when the document performs a redo Triggers when the window is resized Triggers when an element s scrollbar is being scrolled Triggers when a media element s seeking attribute is no longer true and the seeking has ended Triggers when a media element s seeking attribute is true and the seeking has begun Triggers when an element is selected Triggers when there is an error in fetching media data Triggers when a document loads Triggers when a form is submitted Triggers when the browser has been fetching me
8. Cc Tutorials Point Simply Easy Learning HTML 5 Tutorial Tutorialspoint com HTML Simply Easy Learning HTMLS is the latest and most enhanced version of HTML Technically HTML is not a programming language but rather a markup language This tutorial gives very good understanding on HTML5 HTML5 Overview HTMLS is the next major revision of the HTML standard superseding HTML 4 01 XHTML 1 0 and XHTML 1 1 HTMLS is a standard for structuring and presenting content on the World Wide Web HTMLS5 is a cooperation between the World Wide Web Consortium W3C and the Web Hypertext Application Technology Working Group WHATWG The new standard incorporates features like video playback and drag and drop that have been previously dependent on third party browser plug ins such as Adobe Flash Microsoft Silverlight and Google Gears Browser Support The latest versions of Apple Safari Google Chrome Mozilla Firefox and Opera all support many HTMLS5 features and Internet Explorer 9 0 will also have support for some HTML5 functionality The mobile web browsers that come pre installed on iPhones iPads and Android phones all 1 Page z Tutorials Point Simply Easy Learning TUTORIALS POINT have excellent support for HTML5 New Features HTMLS5 introduces a number of new elements and attributes that helps in building a modern websites Following are great features introduced in HTML5 New Semantic Elements These
9. Rotation This method is used to rotate the canvas around the current origin Canvas Scaling This method is used to increase or decrease the units in a canvas grid These methods allow modifications directly to the transformation matrix 21 Page Canvas Composition This method is used to mask off certain areas or clear sections from the canvas Canvas Animation Learn how to create basic animation using HTML5 canvas and Javascript For complete Tutorial http www tutorialspoint com html5 List of Tutorials from TutorialsPoint com Learn JSP Learn ASP Net Learn Servlets Learn HTML Learn log4j Learn HTMLS Learn iBATIS Learn XHTML Learn Java Learn CSS Learn JDBC Learn HTTP Java Examples Learn Best Practices Learn Python Learn Ruby Learn Ruby on Rails Learn SQL Learn MySQL Learn AJAX Learn C Programming Learn C Programming Learn CGI with PERL Learn DLL Learn ebXML Learn Euphoria Learn GDB Debugger Learn Makefile Learn Parrot Learn Perl Script Learn PHP Script Learn Six Sigma Learn SEI CMMI Learn WiMAX Learn Telecom Billing Learn JavaScript Learn jQuery Learn Prototype Learn script aculo us Web Developer s Guide Learn RADIUS Learn RSS Learn SEO Techniques Learn SOAP Learn UDDI Learn Unix Sockets Learn Web Services Learn XML RPC Learn UML Learn UNIX Learn WSDL Learn i Mode Learn GPRS Learn GSM Learn WAP Learn WML Learn Wi Fi w
10. ands for Scalable Vector Graphics and it is a language for describing 2D graphics and graphical applications in XML and the XML is then rendered by an SVG viewer SVG is mostly useful for vector type diagrams like Pie charts Two dimensional graphs in an X Y coordinate system etc SVG became a W3C Recommendation 14 January 2003 and you can check latest version of SVG specification at SVG Specification Viewing SVG Files Most of the web browsers can display SVG just like they can display PNG GIF and JPG Internet Explorer users may have to install the Adobe SVG Viewer to be able to view SVG in the browser Embeding SVG in HTML5 HTMLS5 allows embeding SVG directly using lt svg gt lt svg gt tag which has following simple syntax lt svg xmlns http www w3 org 2000 svg gt lt svg gt Firefox 3 7 has also introduced a configuration option about config where you can enable HTMLS5 using the following steps 1 Type about config in your Firefox address bar 2 Click the I ll be careful I promise button on the warning message that appears and make sure you adhere to it 3 Type html5 enable into the filter bar at the top of the page 12 Page 4 Currently it would be disabled so click it to toggle the value to true Now your Firefox HTML5 parser should now be enabled and you should be able to experiment with the following examples HTML5 SVG Circle Following is the HTML5 version of an SVG exam
11. are like lt header gt lt footer gt and lt section gt Forms 2 0 Improvements to HTML web forms where new attributes have been introduced for lt input gt tag Persistent Local Storage To achieve without resorting to third party plugins WebSocket A a next generation bidirectional communication technology for web applications e Server Sent Events HTML5 introduces events which flow from web server to the web browsers and they are called Server Sent Events SSE e Canvas This supports a two dimensional drawing surface that you can program with JavaScript e Audio amp Video You can embed audio or video on your web pages without resorting to third party plugins e Geolocation Now visitors can choose to share their physical location with your web application e Microdata This lets you create your own vocabularies beyond HTML5 and extend your web pages with custom semantics e Drag and drop Drag and drop the items from one location to another location on a the same webpage Backward Compatibility HTML5 is designed as much as possible to be backward compatible with existing web browsers New features build on existing features and allow you to provide fallback content for older browsers It is suggested to detect support for individual HTML5 features using a few lines of JavaScript If you are not familiar with any previous version of HTML I would recommend to go through our HTML Tutorial before you explore further conce
12. close The close method would be used to terminate any existing connection WebSocket Example A WebSocket is a standard bidirectional TCP socket between the client and the server The socket starts out as a HTTP connection and then Upgrades to a TCP socket after a HTTP handshake After the handshake either side can send data Client Side HTML amp JavaScript Code At the time of writing this tutorial there are only few web browsers supporting WebSocket interface You can try following example with latest version of Chrome Mozilla Opera and Safari lt DOCTYPE HTML gt lt html gt lt head gt lt script type text javascript gt function WebSocketTest if WebSocket in window alert WebSocket is supported by your Browser Let us open a web socket var ws new WebSocket ws localhost 9998 echo ws onopen function 18 Page z Tutorials Point Simply Easy Learning TUTORIALS POINT Web Socket is connected send data using send ws send Message to send alert Message is sent he ws onmessage function evt var received _ msg evt data alert Message is received be ws onclose function websocket is closed alert Connection is closed The browser doesn t support WebSocket alert WebSocket NOT supported by your Browser lt serclpoc gt lt head gt lt body gt lt div id sse gt l
13. d Classifies an element for use with Cascading Style Sheets contenteditable true false Specifies if the user can edit the element s content or not 5 Page e z Tutorials Point Simply Easy Learning TUTORIALS POINT contextmenu data XXXX draggable height hidden id item itemprop spellcheck style subject tabindex title valign width Menu id User Defined true false auto Numeric Value hidden User Defined List of elements List of items true false CSS Style sheet User define id Tab number User Defined top middle bottom Numeric Value Specifies the context menu for an element Custom attributes Authors of a HTML document can define their own attributes Must start with data Specifies whether or not a user is allowed to drag an element Specifies the height of tables images or table cells Specifies whether element should be visible or not Names an element for use with Cascading Style Sheets Used to group elements Used to group items Specifies if the element must have it s spelling or grammar checked Specifies an inline style for an element Specifies the element s corresponding item Specifies the tab order of an element Pop up title for your elements Vertically aligns tags within an HTML element Specifies the width of tables images or table cells For a complete list of HTML5 Tags and related attributes plea
14. dia data but stopped before the entire media file was fetched Triggers when media changes its playing position Triggers when a document performs an undo Triggers when the user leaves the document Triggers when media changes the volume also when volume is set to mute Triggers when media has stopped playing but is expected to resume Web Forms 2 0 is an extension to the forms features found in HTML4 Form elements and attributes in HTML5 provide a greater degree of semantic mark up than HTML4 and remove a great deal of the need for tedious scripting and styling that was required in HTML4 The lt input gt element in HTML4 HTML4 input elements use the type attribute to specify the data type HTML4 provides following types Type text password checkbox 9 Page Description A free form text field nominally free of line breaks A free form text field for sensitive information nominally free of line breaks A set of zero or more values from a predefined list C z Tutorials Point Simply Easy Learning TUTORIALS POINT radio An enumerated value submit A free form of button initiates form submission file An arbitrary file with a MIME type and optionally a file name image A coordinate relative to a particular image s size with the extra semantic that it must be the last value selected and initiates form submission hidden An arbitrary string that is not normally displayed to the user select An enu
15. do simple and not so simple animations Here is a simple lt canvas gt element which has only two specific attributes width and height plus all the core HTML5 attributes like id name and class etc lt canvas id mycanvas width 100 height 100 gt lt canvas gt You can easily find that lt canvas gt element in the DOM using getElementById method as follows var canvas document getElementById mycanvas Let us see a simple example on using lt canvas gt element in HTML5 document lt DOCTYPE HTML gt lt html gt lt head gt lt style gt mycanvas Isom erareloxans Oletclenaccr lt style gt lt head gt lt body gt lt canvas id mycanvas width 100 height 100 gt lt canvas gt lt body gt lt html gt The Rendering Context The lt canvas gt is initially blank and to display something a script first needs to access the rendering context and draw on it The canvas element has a DOM method called getContext used to obtain the rendering context and its drawing functions This function takes one parameter the type of context 2d Following is the code to get required context along with a check if your browser supports lt canvas gt element var canvas document getElementById mycanvas if canvas getContext var ctx canvas getContext 2d drawing code here eles canvas unsupported code here 20 Page Browser Support The latest versions
16. ebmaster TutorialsPoint com 22 Page 23 Page
17. et object as mentioned above Attribute Description Socket readyState The readonly attribute readyState represents the state of the connection It can have the following values 1 A value of O indicates that the connection has not yet been established 2 A value of 1 indicates that the connection is established and communication is possible 3 A value of 2 indicates that the connection is going through the closing handshake 4 A value of 3 indicates that the connection has been closed or could not be opened Socket bufferedAmount The readonly attribute bufferedAmount represents the number of bytes of UTF 8 text that have been queued using send method WebSocket Events 17 Page Cc z Tutorials Point Simply Easy Learning TUTORIALS POINT Following are the events associated with WebSocket object Assuming we created Socket object as mentioned above Event Event Handler Description open Socket onopen This event occurs when socket connection is established message Socket onmessage This event occurs when client receives data from server error Socket onerror This event occurs when there is any error in communication close Socket onclose This event occurs when connection is closed WebSocket Methods Following are the methods associated with WebSocket object Assuming we created Socket object as mentioned above Method Description Socket send The send data method transmits data using the connection Socket
18. lt nav gt lt nav gt 4 Page Cc z Tutorials Point Simply Easy Learning TUTORIALS POINT lt article gt lt section gt lt section gt lt article gt lt aside gt lt aside gt lt footer gt lt footer gt lt body gt HTMLS5 Attributes As explained in previous chapter elements may contain attributes that are used to set various properties of an element Some attributes are defined globally and can be used on any element while others are defined for specific elements only All attributes have a name and a value and look like as shown below in the example Following is the example of an HTML5 attributes which illustrates how to mark up a div element with an attribute named class using a value of example lt div class example gt lt div gt Attributes may only be specified within start tags and must never be used in end tags HTMLS5 attributes are case insensitive and may be written in all uppercase or mixed case although the most common convention is to stick with lowercase Standard Attributes The attributes listed below are supported by almost all the HTML 5 tags Attribute Options Function accesskey User Defined Specifies a keyboard shortcut to access an element align right left center Horizontally aligns tags background URL Places an background image behind an element bgcolor numeric hexidecimal Places a background color behind an element RGB values class User Define
19. merated value much like the radio type textarea A free form text field nominally with no line break restrictions button A free form of button which can initiates any event related to button Following is the simple example of using labels radio buttons and submit buttons lt form action http example com cgiscript pl method post gt lt p gt lt label for firstname gt first name lt label gt lt input type text id firstname gt lt br gt lt label for lastname gt last name lt label gt lt input type text id lastname gt lt br gt lt label for email gt email lt label gt lt input type text id email gt lt br gt lt input type radio name Sex value male gt Male lt br gt lt input type radio name sex value female gt Female lt br gt lt input type submit value send gt lt input type reset gt lt p gt lt form gt The lt input gt element in HTML5 Apart from the above mentioned attributes HTML5 input elements introduced sevral new values for the type attribute These are listed below NOTE Try all the following example using latest version of Opera browser Type Description datetime A date and time year month day hour minute second fractions of a second encoded according to ISO 8601 with the time zone set to UTC 10 Page e z Tutorials Point Simply Easy Learning TUTORIALS POINT datetime local A date and time year month day hou
20. of Firefox Safari Chrome and Opera all support for HTML5 Canvas but IE8 does not support canvas natively You can use ExplorerCanvas to have canvas support through Internet Explorer You just need to include this javascript as follows E gt lt script src excanvas js gt lt script gt lt endif gt p J p HTML5 Canvas Examples This tutorial covers following examples related to HTML5 lt canvas gt element O aS eee Drawing Rectangles Learn how to draw rectangle using HTML5 lt canvas gt element Drawing Paths Learn how to make shapes using paths in HTML5 lt canvas gt element g Lines Learn how to draw lines using HTML5 lt canvas gt element g Bezier Learn how to draw bezier curve using HTML5 lt canvas gt element i Ss Drawing Quadratic Learn how to draw quadratic curve using HTML5 lt canvas gt element g Image Learn how to use images with HTML5 lt canvas gt element Create Gradients Learn how to create gradients using HTML5 lt canvas gt element Styles and Colors Learn how to apply styles and colors using HTML5 lt canvas gt element Text and Fonts Learn how to draw amazing text using different fonts and their size Pattern and Shadow Learn how to draw different patterns and drop shadows Canvas States Learn how to save and restore canvas states while doing complex drawings on a canvas Canvas Translation This method is used to move the canvas and its origin to a different point in the grid Canvas
21. ple which would draw a cricle using lt circle gt tag lt DOCTYPE html gt lt head gt lt title gt SVvG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Circle lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt Caliacils alel Viescloslisolls ExT 50 eySr50 i Y50 iesilleVigech gt lt svg gt lt body gt lt html gt This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Circle HTML5 SVG Rectangle Following is the HTML5 version of an SVG example which would draw a rectangle using lt rect gt tag lt DOCTYPE html gt lt head gt lt title gt SVG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2 gt HTML5 SVG Rectangle lt h2 gt lt svg id svgelem height 200 xmlns http www w3 org 2000 svg gt lt rect id redrect width 300 height 100 fill red gt lt svg gt lt body gt lt html gt 13 Page se Sony A NA TUTORIALS PO SIMPLY EASY LEARNING This would produce following result in HTML5 enabled latest version of Firefox HTMLS SVG Rectangle HTML5 SVG Line Following is the HTML5 version of an SVG example which would draw a line using lt line gt tag LDOCE memi lt head gt lt title gt SVG lt title gt lt meta charset utf 8 gt lt head gt lt body gt lt h2
22. pts of HTM5 HTMLS Syntax The HTML 5 language has a custom HTML syntax that is compatible with HTML 4 and XHTML1 documents published on the Web but is not compatible with the more esoteric SGML features of HTML 4 HTML 5 does not have the same syntax rules as XHTML where we needed lower case tag names quoting our attributes an attribute had to have a value and to close all empty elements But HTML5 is coming with lots of flexibility and would support the followings Uppercase tag names Quotes are optional for attributes Attribute values are optional Closing empty elements are optional The DOCTYPE DOCTYPEs in older versions of HTML were longer because the HTML language was SGML based 2 Page and therefore required a reference to a DTD HTML 5 authors would use simple syntax to specify DOCTYPE as follows DOCE NEm All the above syntax is case insensitive Character Encoding HTML 5 authors can use simple syntax to specify Character Encoding as follows lt meta charset UTF 8 gt All the above syntax is case insensitive The lt script gt tag It s common practice to add a type attribute with a value of text javascript to script elements as follows lt script type text javascript src scriptfile js gt lt script gt HTML 5 removes extra information required and you can use simply following syntax lt script src scriptfile js gt lt script gt The lt link gt tag So far
23. r minute second fractions of a second encoded according to ISO 8601 with no time zone information ate A date year month day encoded according to ISO 8601 month A date consisting of a year and a month encoded according to ISO 8601 week A date consisting of a year and a week number encoded according to ISO 8601 time A time hour minute seconds fractional seconds encoded according to ISO 8601 number This accepts only numerical value The step attribute specifies the precision defaulting to 1 range The range type is used for input fields that should contain a value from a range of numbers email This accepts only email value This type is used for input fields that should contain an e mail address If you try to submit a simple text it forces to enter only email address in email example com format url This accepts only URL value This type is used for input fields that should contain a URL address If you try to submit a simple text it forces to enter only URL address either in http www example com format or in http example com format The lt output gt element HTML5 introduced a new element lt output gt which is used to represent the result of different types of output such as output written by a script You can use the for attribute to specify a relationship between the output element and other elements in the document that affected the calculation for example as inputs or parameters The value
24. se check reference to HTML5 Tags Custom Attributes A new feature being introduced in HTML 5 is the addition of custom data attributes A custom data attribute starts with data and would be named based on your requirement Following is the simple example lt div class example data subject physics data level complex gt lt div gt 6 Page z Tutorials Point Simply Easy Learning TUTORIALS POINT The above will be perfectly valid HTML5 with two custom attributes called data subject and data level You would be able to get the values of these attributes using JavaScript APIs or CSS in similar way as you get for standard attributes HTML5 Events When a user visit your website they do things like click on text and images and given links hover over things etc These are examples of what JavaScript calls events We can write our event handlers in Javascript or vbscript and you can specify these event handlers as a value of event tag attribute The HTML5 specification defines various event attributes as listed below There are following attributes which can be used to trigger any javascript or vbscript code given as value when there is any event occurs for any HTM5 element We would cover element specific events while discussing those elements in detail in subsequent chapters Attribute Value Description offline script Triggers when the document goes offline onabort script Triggers on an abort event onafterprint
25. t a href javascript WebSocketTest gt Run WebSocket lt a gt lt div gt lt body gt lt html gt Install pywebsocket Before you test above client program you need a server which supports WebSocket Download mod_pywebsocket x x x tar gz from pywebsocket which aims to provide a Web Socket extension for Apache HTTP Server ans install it following these steps Unzip and untar the downloaded file Go inside pywebsocket x x x src directory python setup py build sudo python setup py install Then read document by o pydoc mod_pywebsocket Or Pe ie This will install it into your python environment Start the Server Go to the pywebsocket x x x src mod_pywebsocket folder and run the following command Ssudo python standalone py p 9998 w example This will start the server listening at port 9998 and use the handlers directory specified by the w option where our echo_wsh py resides Now using Chrome browser open the html file your created in the beginning If your browser supports WebSocket then you would get alert indicating that your browser supports 19 Page z Tutorials Point Simply Easy Learning TUTORIALS POINT WebSocket and finally when you click on Run WebSocket you would get Goodbye message sent by the server script HTML5 Canvas HTML5 element lt canvas gt gives you an easy and powerful way to draw graphics using JavaScript It can be used to draw graphs make photo compositions or
26. ute named class using a value of example lt div class example gt lt div gt Attributes may only be specified within start tags and must never be used in end tags HTMLS5 attributes are case insensitive and may be written in all uppercase or mixed case although the most common convention is to stick with lowercase HTML5 Document The following tags have been introduced for better structure e section This tag represents a generic document or application section It can be used together with hi h6 to indicate the document structure e article This tag represents an independent piece of content of a document such as a blog entry or newspaper article e aside This tag represents a piece of content that is only slightly related to the rest of the page e header This tag represents the header of a section e footer This tag represents a footer for a section and can contain information about the author copyright information et cetera e nav This tag represents a section of the document intended for navigation dialog This tag can be used to mark up a conversation figure This tag can be used to associate a caption together with some embedded content such as a graphic or video The markup for an HTM 5 document would look like the following lt DOGRYPE Hem lt html gt lt head gt lt meta charset utf 8 gt SeiclSe gt s o lt title gt lt head gt lt body gt lt header gt lt header gt
27. you were writing lt link gt as follows lt link rel stylesheet type text css href stylefile css gt HTML 5 removes extra information required and you can use simply following syntax lt link rel stylesheet nret styler le CSSS HTML5 Elements HTML5 elements are marked up using start tags and end tags Tags are delimited using angle brackets with the tag name in between The difference between start tags and end tags is that the latter includes a slash before the tag name Following is the example of an HTML5 element GIs a a S D 3 Page Cc z Tutorials Point Simply Easy Learning TUTORIALS POINT HTMLS5 tag names are case insensitive and may be written in all uppercase or mixed case although the most common convention is to stick with lowercase Most of the elements contain some content like lt p gt lt p gt contains a paragraph Some elements however are forbidden from containing any content at all and these are known as void elements For example br hr link and meta etc HTML5 Attributes Elements may contain attributes that are used to set various properties of an element Some attributes are defined globally and can be used on any element while others are defined for specific elements only All attributes have a name and a value and look like as shown below in the example Following is the example of an HTML5 attributes which illustrates how to mark up a div element with an attrib
Download Pdf Manuals
Related Search
Related Contents
介護用ベッド等の安全性を高めるためのJISの改正(別添5)(PDF:200KB) Mode d`emploi Istruzioni per l`uso e l`installazione POWER FACTOR CONTROLLER - Westech Electric Limited 40種工具セット 種工具セット Les groupements d`achats : Une affaire de prix - Allize AVH-P4100DVD - Esoteric Car System Accu LED MH.indd - Amazon Web Services Homework 13: User Manual Pyle PHRM38 Copyright © All rights reserved.
Failed to retrieve file