HTML5 - Tutorialspoint

Transcription

HTML5

HTML5About the TutorialHTML5 is the latest and most enhanced version of HTML. Technically, HTML is not aprogramming language, but rather a markup language. In this tutorial, we will discuss thefeatures of HTML5 and how to use it in practice.AudienceThis tutorial has been designed for beginners in HTML5 to make them understand the basicto-advanced concepts of the subject.PrerequisitesBefore starting this tutorial, you should have a basic understanding of HTML and its tags.Disclaimer & Copyright Copyright 2016 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I)Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute, or republishany contents or a part of contents of this e-book in any manner without written consent ofthe publisher.We strive to update the contents of our website and tutorials as timely and as precisely aspossible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.Ltd. provides no guarantee regarding the accuracy, timeliness, or completeness of our websiteor its contents including this tutorial. If you discover any errors on our website or in thistutorial, please notify us at contact@tutorialspoint.com

HTML5Execute HTML5 OnlineFor most of the examples given in this tutorial you will find Try it option, so just make use ofthis option to execute your HTML5 programs at the spot and enjoy your learning.Try following example using Try it option available at the top right corner of the below samplecode box !DOCTYPE html html head meta charset "utf-8" title Tutorials Point /title /head body header role "banner" h1 HTML5 Document Structure Example /h1 p This page should be tried in safari, chrome or Mozila. /p /header footer p Created by a href "http://tutorialspoint.com/" TutorialsPoint /a /p /footer /body /html

HTML5Table of ContentsAbout the Tutorial . 1Audience . 1Prerequisites . 1Execute HTML5 Online . 2Table of Contents . 31.HTML5 OVERVIEW . 9Browser Support . 9New Features . 9Backward Compatibility . 102.HTML5 SYNTAX . 11The DOCTYPE . 11Character Encoding . 11The script tag . 11The link tag . 12HTML5 Elements . 12HTML5 Attributes . 12HTML5 Document . 133.HTML5 ATTRIBUTES . 16Standard Attributes. 16Custom Attributes . 174.HTML5 EVENTS . 185.HTML5 WEB FORMS 2.0 . 21

HTML5The input element in HTML4 . 21The input element in HTML5 . 22HTML5 - datetime . 23HTML5 - datetime local . 24HTML5 – date . 24HTML5 – month. 25HTML5 - week . 26HTML5 – time . 27HTML5 – number. 27HTML5 – range . 28HTML5 - email . 29HTML5 – URL . 30The output element. 30The placeholder attribute. 32The autofocus attribute . 32The required attribute. 336.HTML5 SVG. 35Viewing SVG Files . 35Embedding SVG in HTML5 . 35HTML5 SVG Circle . 36HTML5 SVG Rectangle . 36HTML5 SVG Line . 37HTML5 SVG Ellipse . 38HTML5 SVG Polygon . 39HTML5 SVG Polyline . 40

HTML5HTML5 SVG Gradients . 40HTML5 SVG Star . 427.HTML5 MATHML . 44MathML Examples . 44Using MathML Characters . 45Matrix Presentation Examples . 478.HTML5 WEB STORAGE. 49Session Storage . 49Local Storage . 50Delete Web Storage . 519.HTML5 WEB SQL DATABASE . 54The Core Methods . 54Opening Database . 54Executing queries . 55INSERT Operation . 55READ Operation . 55Final Example . 5610. HTML5 SERVER SENT EVENTS . 58Web Application for SSE . 58Server Side Script for SSE. 59Handle Server-Sent Events . 6011. HTML5 WEBSOCKETS . 61WebSocket Attributes . 61

HTML5WebSocket Events . 62WebSocket Methods . 62WebSocket Example . 62Client Side HTML & JavaScript Code . 62Install pywebsocket . 64Start the Server . 6412. HTML5 CANVAS . 65The Rendering Context . 66Browser Support . 66HTML5 Canvas Examples . 66HTML5 Canvas - Drawing Rectangles . 67HTML5 Canvas - Drawing Paths . 69HTML5 Canvas - Drawing Lines .

The user of this e-book is prohibited to reuse, retain, copy, distribute, or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no .