, , to group related form controls and add structure. - Browsers can now perform built-in form validation without JavaScript by leveraging new attributes like required, pattern, and more. - HTML5 simplifies markup for forms and removes deprecated tags to clean up code and semantics. Overall, HTML5 aims to make forms more usable, consistent,">, , to group related form controls and add structure. - Browsers can now perform built-in form validation without JavaScript by leveraging new attributes like required, pattern, and more. - HTML5 simplifies markup for forms and removes deprecated tags to clean up code and semantics. Overall, HTML5 aims to make forms more usable, consistent,"> Address: [go: up one dir, main page] Include Form Remove Scripts Session Cookies Open navigation menuClose suggestionsSearchSearchenChange LanguageUploadSign inSign inDownload free for days0 ratings0% found this document useful (0 votes)71 views56 pagesWT Chap2 HTML5 FormsHTML5 introduces new form controls and validation features to simplify creating forms and improve the user experience. Some key points: - HTML5 adds several new input types like email, url, number, and date pickers to make it easier for browsers to validate user input. - HTML5 introduces new semantic form elements like <fieldset>, <legend>, <output> to group related form controls and add structure. - Browsers can now perform built-in form validation without JavaScript by leveraging new attributes like required, pattern, and more. - HTML5 simplifies markup for forms and removes deprecated tags to clean up code and semantics. Overall, HTML5 aims to make forms more usable, consistent,Uploaded byBrandon StarkAI-enhanced title and descriptionCopyright© © All Rights ReservedWe take content rights seriously. If you suspect this is your content, claim it here.Available FormatsDownload as PDF, TXT or read online on ScribdDownload nowDownloadSave WT_Chap2_HTML5_Forms For LaterDownloadSaveSave WT_Chap2_HTML5_Forms For Later0%0% found this document useful, undefined0%, undefinedEmbedSharePrintReport0 ratings0% found this document useful (0 votes)71 views56 pagesWT Chap2 HTML5 FormsHTML5 introduces new form controls and validation features to simplify creating forms and improve the user experience. Some key points: - HTML5 adds several new input types like email, url, number, and date pickers to make it easier for browsers to validate user input. - HTML5 introduces new semantic form elements like <fieldset>, <legend>, <output> to group related form controls and add structure. - Browsers can now perform built-in form validation without JavaScript by leveraging new attributes like required, pattern, and more. - HTML5 simplifies markup for forms and removes deprecated tags to clean up code and semantics. Overall, HTML5 aims to make forms more usable, consistent,Uploaded byBrandon StarkAI-enhanced title and descriptionCopyright© © All Rights ReservedWe take content rights seriously. If you suspect this is your content, claim it here.Available FormatsDownload as PDF, TXT or read online on ScribdDownload nowDownloadSave WT_Chap2_HTML5_Forms For LaterCarousel PreviousCarousel NextDownloadSaveSave WT_Chap2_HTML5_Forms For Later0%0% found this document useful, undefined0%, undefinedEmbedSharePrintReportDownload nowDownloadYou are on page 1/ 56SearchFullscreenHTML 5 FormsHTML 5 HTML5 will be the new standard for HTML, XHTML, and the HTML DOM (document object model). The previous version of HTML came in 1999. The web has changed a lot since then. HTML5 is still a work in progress, but most modern browsers have some HTML5 support.How is it different from HTML5 ?Some rules for HTML5 were established:> New features should be based on HTML, CSS, DOM, and JavaScript> Reduce the need for external plugins> Better error handling> More markup to replace scripting> HTML5 should be device independent> Dev process should be visible to the publicHTML5: New Features> Canvas element for drawing>Video/audio elements for media playback> Better support for local offline storage> New content specific elements, like article,footer, header, nav, section> New form controls, like calendar, date, time, email, url, searchHTML5: Simplification of codeMarkup version HTML4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd> HTML5 <!DOCTYPE html>Metadata <meta http-equiv="content-type" HTML4 content="text/html; charset=UTF-8" /> HTML5 <meta charset=''utf-8''/>Dropped Tags basefont, big, center, font, strike, tt acronym, applet, isindex frame, frameset, noframes New Tags for Page Layout Today, if we wanted to markup a layout for a web page, we would use a lot of <div> tags to specify the different sections of the page. HTML5 introduces a set of new tags specifically for layout. 7 HTML 4: Structure No semantics in layout <div id=“header”> <div class=“post”> <divid=“sidebar”> <div class=“post”> <div id=“footer”> HTML5: Semantic markup <header”> <section> <header><nav> <article> <aside> <footer> <header”>1011 HTML 5 Elements like <header> and <footer> are not meant to be only at the top and bottom of the page. <header> and <footer> may be for each document section Not very different from <div> tag, but are more semantically well-defined in the document structure Better layout structure → new structural elements <section> <header> <nav> <article> <aside> <footer> 121314HTML5: Semantic elements example <header> <nav> <aside> <section> <footer> HTML 5<mark> For text that should be highlighted<nav> For a section of navigation<section> For a section in a document (e.g. chapters, headers, footers)<wbr> Word break. For defining an appropriate place to break a long word or sentenceOther tags <command>, <datalist>, <details>, <progress>, etc. 16 4. FormsHTML5 not only makes marking up forms easier on the developer, it’s also better for the user. With client-side validation being handled natively by the browser, there will be greater consistency across different sites, and many pages will load faster without all that redundant JavaScript.Lets look at HTML5 Form Attributes HTML5 Input Types HTML5 Form Elements HTML Forms Forms are the primary method for gathering data from site visitors Create a form block with <form></form> The “method" attribute tells how Example: the form data should be sent – via GET or POST request <form name="myForm" method="post" action="path/to/some- action="path/to/some-script.php"> ... </form> The "action" attribute tells where the form data should be sent 18 The <form> tag The <form arguments> ... </form> tag encloses form elements (and probably other HTML as well) The arguments to form tell what to do with the user input action="url"(required) Specifies where to send the data when the Submit button is clicked method="get" (default) Form data is sent as a URL with ?form_data info appended to the end Can be used only if data is all ASCII and not more than 100 characters method="post" Form data is sent in the body of the URL request Cannot be bookmarked by most browsers target="target" Tells where to open the page sent as a result of the request target= _blank means open in a new window target= _top means use the same window 19 HTML 5 FormsForm and Form Element attributes autofocus – Receive the focus when the page loads autocomplete – indicates that this element’s value may be remembered for future entries novalidate, formnovalidate – indicates that the browser should not validate the form (used on the form) The novalidate attribute is a boolean attribute. pattern – Restrict the input of the field to match a regular expression pattern required – mandatory field placeholder – specifies text that appears in the element until the user enters an actual valueNote: The formnovalidate attribute can be used with type="submit".When autocomplete is on, the browser automatically complete valuesbased on values that the user has entered before. The <input> tag Most, but not all, form elements use the input tag, with a type="..." argument to tell which kind of element it is type can be text, checkbox, radio, password, hidden, submit, reset, button, file, or image Other common input tag arguments include: name: the name of the element value: the “value” of the element; used in different ways for different values of type readonly: the value cannot be changed disabled: the user can’t do anything with this element Other arguments are defined for the input tag but have meaning only for certain values of type. 21 HTML5: Input typesHTML5 has several new input types for forms. > email > url > tel > number > range > date pickers (date, month, week, time, datetime, datetime-local) > search > colorHTML5: Input types Note: Opera has the best support for the new input types. If other browsers are not supported, they will behave as regular text fields. Text inputA text field: <input type="text" name="textfield" value=“initial value“ size=“15”>A multi-line text field <textarea name="textarea" cols="24" rows="2">Hello</textarea> A password field: <input type="password" name="textfield3" value="secret"> 24 Labels Form labels are used to associate an explanatory text to a form field using the field's ID. <label for="fn">First Name</label> <input type="text" id="fn" /> Clicking on a label focuses its associated field (checkboxes are toggled, radio buttons are checked) Labels are both a usability and accessibility feature and are required in order to pass accessibility validation. 25 Hidden / File fields<input type="hidden" name="hiddenField" value="nyah">• type="file" – provides a file dialogue box to specify a file that is sent to the server What good is this? All input fields are sent back to the server, including hidden fields This is a way to include information that the user doesn’t need to see (or that you don’t want her to see) The value of a hidden field can be set programmatically (by JavaScript) before the form is submitted 26 Checkboxes A checkbox: <input type="checkbox" name="checkbox” value="checkbox" checked> type: "checkbox" name: used to reference this form element from JavaScript value: value to be returned when element is checked Note that there is no text associated with the checkbox—you have to supply text in the surrounding HTML <input type="image" src="submit.gif" name="submitBtn" alt="Submit" /> 27 Radio buttonsRadio buttons:<br> <input type="radio" name="radiobutton" value="myValue1"> male<br> <input type="radio" name="radiobutton" value="myValue2" checked> female If two or more radio buttons have the same name, the user can only select one of them at a time This is how you make a radio button “group” If you ask for the value of that name, you will get the value specified for the selected radio button As with checkboxes, radio buttons do not contain any text 28 Fieldsets Fieldsets are used to enclose a group of related form fields The <legend> is the fieldset's title. <form method="post" action="form.aspx"> <fieldset> <legend>Client Details</legend> <input type="text" id="Name" /> <input type="text" id="Phone" /> </fieldset> <fieldset> <legend>Order Details</legend> <input type="text" id="Quantity" /> <textarea cols="40 cols="40"" rows="10 rows="10"" id="Remarks"></textarea> </fieldset> </form> 29 HTML5: Input - e-mailThe email type is used for input fields that shouldcontain an e-mail address.It supports the Boolean multiple attribute, allowingfor multiple, comma-separated email addresses.The value of the email field is automaticallyvalidated when the form is submitted.E-mail: <input type="email" name="user_email" /> HTML5: Input - urlThe url type is used for input fields that should contain a URLaddress.The value of the url field is automatically validated when theform is submitted.Homepage: <input type="url" name="user_url" /> HTML5: Input - numberThe number type is used for input fields that should contain anumeric value.Set restrictions on what numbers are accepted:Points: <input type="number" name="points"min="1" max="10" /> HTML5: Input - rangeThe range type is used for input fields that should contain a valuefrom a range of numbers.The range type is displayed as a slider bar.You can also set restrictions on what numbers are accepted:<label for="rating">On a scale of 1 to 10, knowledge ofHTML5 is: </label><input type="range" min="1" max="10" name="rating"type="range"> HTML5: Input – date pickersHTML5 has several new input types for selecting date and time: > date - Selects date, month and year > month - Selects month and year > week - Selects week and year > time - Selects time (hour and minute) > datetime - Selects time, date, month and year > datetime-local - Selects time, date, month and year (local time) HTML5: Input - searchThe search type is used for search fields like a sitesearch or Google search.The search field behaves like a regular text field.Search type is only supported in Chrome, Opera, andsafari.Search Google:<input type="search“ name="googlesearch" /> HTML5: Input – color pickerThe color type is used for input fields that should contain acolor.This input type will allow you to select a color from a colorpicker:Color: <input type="color" name="user_color" /> HTML5: Input - formHTML5 has several new elements and attributes forforms. > datalist• Datalists are currently only supported in Firefox and Opera, but they are very cool.• They fulfill a common requirement: a text field with a set of predefined autocomplete options. <datalist id=“dept”> <option value=“comp”>comp</option> <option value=“inft”>inft</option> <option value=“extc”>extc</option> </datalist> Forms – Input Attributes<input> readonly Attribute The readonly attribute is similar to the disabled attribute: it makes it impossible for the user to edit the form field. Unlike disabled, however, the field can receive focus, and its value is submitted with the form. Forms – Input Attributes<input> multiple Attribute The multiple attribute, if present, indicates that multiple values can be entered in a form control. In HTML5, it can be added to email and file input types as well. At the time of writing, multiple file input is only supported in Chrome, opera, and Firefox.Select images:<input type="file" name="img“ multiple="multiple" /> Forms – Input Types : tel For telephone numbers, use the tel input type (type="tel"). Unlike the url and email types, the tel type doesn’t enforce a particular syntax or pattern. Letters and numbers—indeed, any characters other than new lines or carriage returns—are valid.Telephone: <input type="tel" name="usrtel" /> Forms – keygen <input type> The purpose of the <keygen> element is to provide a secure way to authenticate users. The <keygen> tag specifies a key-pair generator field in a form. When the form is submitted, two keys are generated, one private and one public. The private key is stored locally, and the public key is sent to the server. The public key could be used to generate a client certificate to authenticate the user in the future.<form action="demo_keygen.asp" method="get"> Username: <input type="text" name="usr_name" /> Encryption: <keygen name="security" /> <input type="submit" /></form>HTML5: New form elements<input> types some examples <input type="datetime"> <input type="number" min="18" max="65" step="1"> <input type="range" min="18" max="65" step="10"> HTML5: Audio<!DOCTYPE HTML><html><body><audio src="song.ogg" controls="controls">Your browser does not support the audio element.</audio></body></html> HTML5: Audio<audio controls="controls"> <source src="song.ogg" type="audio/ogg" /> <source src="song.mp3" type="audio/mpeg" />Your browser does not support the audio element.</audio> HTML5: Video<!DOCTYPE HTML><html><body><video src="movie.ogg" width="320" height="240"controls="controls">Your browser does not support the video tag.</video></body></html> HTML5: Video<video width="320" height="240" controls="controls"> <source src="movie.ogg" type="video/ogg" /> <source src="movie.mp4" type="video/mp4" /> <source src="movie.webm" type="video/webm" />Your browser does not support the video tag.</video><video> Attributes: autoplay, controls, loop, height, width, src The <source> element is used when you want to upload multiple audio or video elements.figure ElementAllows for associating captions with embedded content,including images, audio or videos. <figure> Image, audio, video, etc. <figcaption> 48New features include: Semantic elements: header, footer, section, article, others. canvas for drawing paths of rectangles, arcs, lines, images mouse events localStorage (variation of cookies) audio & video elements including drawing video on canvas DrawingCanvas element Screen geometry: upper left corner is origin. stroke versus fill draw Rectangles http://faculty.purchase.edu/jeanine.meyer/html5workshop /wkshopdrawing0.html 500,0,default color,20 by0,0, default color, 10 by 20, fill10, stroke 0,300,green,30 by 30, stroke 500,300, 50 by 50, fill rgb(200,0,100)<!DOCTYPE html><html lang="en"><head><title>Four rectangles</title><meta charset="UTF-8"><script>var ctx;function init() { ctx = document.getElementById('canvas').getContext('2d'); ctx.lineWidth = 2; ctx.strokeRect(0,0,10,10); ctx.fillRect(500,0,20,20); ctx.strokeStyle = "green"; ctx.fillStyle = "rgb(200,0,100)"; ctx.strokeRect(0,300,30,30); ctx.fillRect(500,300,50,50); }</script> </head><body onLoad="init();"> <canvas id="canvas" width="600" height="400"> Your browser doesn't support the HTML5 element canvas.</canvas></body></html>HTMl 5 : New Elements 5354HTML5: Detection [Modernizr] is an open source, MIT-licensed JavaScript library that detects support for many HTML5 & CSS3 features. To use it, include the following <script> element at the top of your page...HTML5: Detection <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML5 sure is fun</title> <script src="modernizr.min.js"></script> </head> <body> ... </body> </html>You might also like05 HTML FormsPDFNo ratings yet05 HTML Forms15 pagesChapter3 Tables&FormsPDFNo ratings yetChapter3 Tables&Forms90 pagesWeb Technologies Lec#5PDFNo ratings yetWeb Technologies Lec#515 pagesLec.03 Html AdvancedPDFNo ratings yetLec.03 Html Advanced19 pagesMy NotesPDFNo ratings yetMy Notes6 pagesHTML Part 2PDFNo ratings yetHTML Part 231 pagesHTML FormPDFNo ratings yetHTML Form37 pagesHTML FormsPDFNo ratings yetHTML Forms13 pagesHTML 5PDFNo ratings yetHTML 583 pages11 HTML FormsPDFNo ratings yet11 HTML Forms13 pagesHTML Forms and CssPDFNo ratings yetHTML Forms and Css7 pagesLecture 3.2 HTML - FormsPDFNo ratings yetLecture 3.2 HTML - Forms50 pagesLecture Notes-HTML Part 3PDFNo ratings yetLecture Notes-HTML Part 310 pagesModule 6 - HTML FormsPDFNo ratings yetModule 6 - HTML Forms63 pagesDay1 Html5 IntroPDFNo ratings yetDay1 Html5 Intro58 pagesWeb Engineering: Lecture # 3 Presented By: Usman ShafiquePDFNo ratings yetWeb Engineering: Lecture # 3 Presented By: Usman Shafique37 pagesChapter 9 (Forms)PDFNo ratings yetChapter 9 (Forms)25 pagesHTML Forms: © Krupa ShahPDFNo ratings yetHTML Forms: © Krupa Shah79 pagesIntro to FormsPDFNo ratings yetIntro to Forms16 pagesFINALREVIEW PDFNo ratings yetFINALREVIEW 120 pagesCH 3 Htmlpart IIPDFNo ratings yetCH 3 Htmlpart II50 pagesChapter 2.part 2PDFNo ratings yetChapter 2.part 275 pagesLecture 04PDFNo ratings yetLecture 0434 pagesWINSEM2024-25_CBS3014_ETH_VL2024250505176_2025-01-03_Reference-Material-IPDFNo ratings yetWINSEM2024-25_CBS3014_ETH_VL2024250505176_2025-01-03_Reference-Material-I24 pagesIii B.SC Widt Unit-IiPDFNo ratings yetIii B.SC Widt Unit-Ii25 pages20 HTML FormsPDFNo ratings yet20 HTML Forms13 pages5-Web Mark Language-Part4(Form) 6PDFNo ratings yet5-Web Mark Language-Part4(Form) 625 pagesInternet Technology 5PDFNo ratings yetInternet Technology 513 pageshtml_formsPDFNo ratings yethtml_forms33 pagesHtml FormsPDFNo ratings yetHtml Forms43 pagesHTML FormsPDFNo ratings yetHTML Forms14 pagesCSS Cascading Style Sheets (CSS) Is A Style Sheet Language Used For Describing The Presentation of APDFNo ratings yetCSS Cascading Style Sheets (CSS) Is A Style Sheet Language Used For Describing The Presentation of A6 pagesWeb Engineering: HTML/XHTML FormsPDFNo ratings yetWeb Engineering: HTML/XHTML Forms14 pagesFront End Lecture 9PDFNo ratings yetFront End Lecture 937 pagesHTMLPDFNo ratings yetHTML31 pagesHtmlformsPDFNo ratings yetHtmlforms12 pageslecture05_wt_html_formsPDFNo ratings yetlecture05_wt_html_forms52 pagesCat 2 Revison Ai and Robotics SS1PDFNo ratings yetCat 2 Revison Ai and Robotics SS117 pagesHTML FormsPDFNo ratings yetHTML Forms7 pagesChapter 2-Lecture 3PDFNo ratings yetChapter 2-Lecture 357 pagesHTML FormsPDFNo ratings yetHTML Forms15 pagesIntroduction To Web Technology HTML Day3PDFNo ratings yetIntroduction To Web Technology HTML Day324 pagesChapter 2 - HTML1PDFNo ratings yetChapter 2 - HTML171 pagesIt8078 Web Design and ManagementPDFNo ratings yetIt8078 Web Design and Management60 pagesX Unit II Chapter 9PDFNo ratings yetX Unit II Chapter 913 pagesLab 02PDFNo ratings yetLab 0216 pagesUnit - II(Widt) PrePDFNo ratings yetUnit - II(Widt) Pre40 pagesIWT LabSheet 4 FormsPDFNo ratings yetIWT LabSheet 4 Forms7 pagesHTML FormsPDFNo ratings yetHTML Forms36 pagesHTML Forms: Pat Morin COMP 2405PDFNo ratings yetHTML Forms: Pat Morin COMP 240520 pagesForm Basics Key Concepts Terry Ann Morris, Ed.DPDFNo ratings yetForm Basics Key Concepts Terry Ann Morris, Ed.D29 pagesjavascriptPDFNo ratings yetjavascript12 pagesHTML Advanced: HTML 5: N.Nalini AP (SR) Scope VITPDFNo ratings yetHTML Advanced: HTML 5: N.Nalini AP (SR) Scope VIT37 pagesLecture 2ABCPDFNo ratings yetLecture 2ABC43 pagesClass-5A-HTMLForm Elements-Form AttributesPDFNo ratings yetClass-5A-HTMLForm Elements-Form Attributes15 pagesConquer Forms With HTML5 and CSS3PDFNo ratings yetConquer Forms With HTML5 and CSS396 pagesCs-344: Web Engineering: Dr. Mehdi HussainPDFNo ratings yetCs-344: Web Engineering: Dr. Mehdi Hussain40 pagesWT Final FilePDF100% (1)WT Final File32 pagesImportant RGPV Question, CS- 504, (a) Internet and Web Technology (IWT), V Sem, CSE, (B.tech.) ? CS.comPDFNo ratings yetImportant RGPV Question, CS- 504, (a) Internet and Web Technology (IWT), V Sem, CSE, (B.tech.) ? CS.com10 pagesHTML5 - Web Forms 2PDFNo ratings yetHTML5 - Web Forms 23 pageshtml ppts (1)PDFNo ratings yethtml ppts (1)21 pagesAWD-UNIT-5PDFNo ratings yetAWD-UNIT-530 pagesLecture 3PDFNo ratings yetLecture 316 pagesHTML Forms - NotesPDFNo ratings yetHTML Forms - Notes5 pagesFlexbox CheatsheetPDFNo ratings yetFlexbox Cheatsheet1 pageOracle Application Express 3.2: The Essentials and MoreFrom EverandOracle Application Express 3.2: The Essentials and MoreArie GellerNo ratings yetFull Stack Developement UNIT - 1PDFNo ratings yetFull Stack Developement UNIT - 117 pagesFactura (INVOIC) - Format XML 2-v80-20210402 - 130343PDFNo ratings yetFactura (INVOIC) - Format XML 2-v80-20210402 - 13034370 pagesIntroduction To HTML+CSS+JavascriptPDF100% (1)Introduction To HTML+CSS+Javascript23 pagesInstalled Files VendorPDFNo ratings yetInstalled Files Vendor27 pagesMessage Compliance Dump Format - 1.6PDF100% (1)Message Compliance Dump Format - 1.640 pagesCss IntroductionPDFNo ratings yetCss Introduction42 pagesE-Book of All CANDLESTICK PatternPDFNo ratings yetE-Book of All CANDLESTICK Pattern35 pagesUnit 2PDFNo ratings yetUnit 211 pagesJavaScript O Guia Definitivo - v2PDFNo ratings yetJavaScript O Guia Definitivo - v246 pagesCss Fundamentals: InheritancePDFNo ratings yetCss Fundamentals: Inheritance21 pagesFront End Foundations Level1PDFNo ratings yetFront End Foundations Level143 pages3 - Reference DocumentationPDFNo ratings yet3 - Reference Documentation11 pagesScribd Download - Com 48 Wetten Van de MachtPDFNo ratings yetScribd Download - Com 48 Wetten Van de Macht30 pages6-Cascading Style SheetPDFNo ratings yet6-Cascading Style Sheet28 pagesAfPDFNo ratings yetAf13 pagesWireshark HTTPPDFNo ratings yetWireshark HTTP3 pages(Solidfiles /X86-Unlocked) : DownloadPDFNo ratings yet(Solidfiles /X86-Unlocked) : Download8 pagesVasavi College of EngineeringPDFNo ratings yetVasavi College of Engineering11 pagesImages/favicon - Ico Js/jquery - Min.js Js/jquery - Dropotron.min - Js Js/skel - Min.js Js/skel-Panels - Min.js Js/init - JsPDFNo ratings yetImages/favicon - Ico Js/jquery - Min.js Js/jquery - Dropotron.min - Js Js/skel - Min.js Js/skel-Panels - Min.js Js/init - Js13 pagesThe HTML Doctype: Hello! HTML5 and CSS3PDFNo ratings yetThe HTML Doctype: Hello! HTML5 and CSS33 pagesSpring Ws MohanPDFNo ratings yetSpring Ws Mohan12 pagesHypertext Markup Language (HTML) Fundamentals: How to Master HTML with EaseFrom EverandHypertext Markup Language (HTML) Fundamentals: How to Master HTML with EaseSteven BrightNo ratings yetRestassured SeleniumPDFNo ratings yetRestassured Selenium6 pagesWhat Is The Web Service Protocol StackPDFNo ratings yetWhat Is The Web Service Protocol Stack3 pages
WT Chap2 HTML5 Forms
AI-enhanced title and description
HTML 5 HTML5 will be the new standard for HTML, XHTML, and the HTML DOM (document object model).
HTML5 <!DOCTYPE html>
HTML5 <meta charset=''utf-8''/>Dropped Tags
7 HTML 4: Structure No semantics in layout
<div id=“header”>
<div class=“post”> <divid=“sidebar”>
<div class=“post”>
<div id=“footer”> HTML5: Semantic markup
<header”> <section>
<header>
<footer>
<header”>1011 HTML 5 Elements like <header> and <footer> are not meant to be only at the top and bottom of the page. <header> and <footer> may be for each document section Not very different from <div> tag, but are more semantically well-defined in the document structure Better layout structure → new structural elements <section> <header> <nav> <article> <aside> <footer> 121314HTML5: Semantic elements example
<nav>
<aside>
<section>
<footer> HTML 5<mark> For text that should be highlighted<nav> For a section of navigation<section> For a section in a document (e.g. chapters, headers, footers)<wbr> Word break. For defining an appropriate place to break a long word or sentenceOther tags <command>, <datalist>, <details>, <progress>, etc.
16 4. FormsHTML5 not only makes marking up forms easier on the developer, it’s also better for the user. With client-side validation being handled natively by the browser, there will be greater consistency across different sites, and many pages will load faster without all that redundant JavaScript.
Lets look at HTML5 Form Attributes HTML5 Input Types HTML5 Form Elements HTML Forms Forms are the primary method for gathering data from site visitors Create a form block with <form></form> The “method" attribute tells how Example: the form data should be sent – via GET or POST request
19 HTML 5 FormsForm and Form Element attributes autofocus – Receive the focus when the page loads autocomplete – indicates that this element’s value may be remembered for future entries novalidate, formnovalidate – indicates that the browser should not validate the form (used on the form) The novalidate attribute is a boolean attribute. pattern – Restrict the input of the field to match a regular expression pattern required – mandatory field placeholder – specifies text that appears in the element until the user enters an actual valueNote: The formnovalidate attribute can be used with type="submit".When autocomplete is on, the browser automatically complete valuesbased on values that the user has entered before. The <input> tag Most, but not all, form elements use the input tag, with a type="..." argument to tell which kind of element it is type can be text, checkbox, radio, password, hidden, submit, reset, button, file, or image Other common input tag arguments include: name: the name of the element value: the “value” of the element; used in different ways for different values of type readonly: the value cannot be changed disabled: the user can’t do anything with this element Other arguments are defined for the input tag but have meaning only for certain values of type. 21 HTML5: Input typesHTML5 has several new input types for forms.
> email > url > tel > number > range > date pickers (date, month, week, time, datetime, datetime-local) > search > colorHTML5: Input types
Note: Opera has the best support for the new input types. If other browsers are not supported, they will behave as regular text fields. Text inputA text field: <input type="text" name="textfield" value=“initial value“ size=“15”>
A password field: <input type="password" name="textfield3" value="secret">
24 Labels Form labels are used to associate an explanatory text to a form field using the field's ID. <label for="fn">First Name</label> <input type="text" id="fn" />
25 Hidden / File fields<input type="hidden" name="hiddenField" value="nyah">
• type="file" – provides a file dialogue box to specify a file that is sent to the server
type: "checkbox" name: used to reference this form element from JavaScript value: value to be returned when element is checked Note that there is no text associated with the checkbox—you have to supply text in the surrounding HTML
If two or more radio buttons have the same name, the user can only select one of them at a time This is how you make a radio button “group” If you ask for the value of that name, you will get the value specified for the selected radio button As with checkboxes, radio buttons do not contain any text 28 Fieldsets Fieldsets are used to enclose a group of related form fields The <legend> is the fieldset's title.
The url type is used for input fields that should contain a URLaddress.
Search Google:<input type="search“ name="googlesearch" /> HTML5: Input – color picker
The color type is used for input fields that should contain acolor.
This input type will allow you to select a color from a colorpicker:
<datalist id=“dept”> <option value=“comp”>comp</option> <option value=“inft”>inft</option> <option value=“extc”>extc</option> </datalist> Forms – Input Attributes
Select images:<input type="file" name="img“ multiple="multiple" /> Forms – Input Types : tel
Unlike the url and email types, the tel type doesn’t enforce a particular syntax or pattern.
The private key is stored locally, and the public key is sent to the server. The public key could be used to generate a client certificate to authenticate the user in the future.
<audio controls="controls"> <source src="song.ogg" type="audio/ogg" /> <source src="song.mp3" type="audio/mpeg" />Your browser does not support the audio element.</audio> HTML5: Video<!DOCTYPE HTML><html><body>
</video>
</body></html> HTML5: Video<video width="320" height="240" controls="controls"> <source src="movie.ogg" type="video/ogg" /> <source src="movie.mp4" type="video/mp4" /> <source src="movie.webm" type="video/webm" />Your browser does not support the video tag.</video><video> Attributes: autoplay, controls, loop, height, width, src The <source> element is used when you want to upload multiple audio or video elements.figure Element
<figure>
<figcaption> 48New features include: Semantic elements: header, footer, section, article, others. canvas for drawing paths of rectangles, arcs, lines, images mouse events localStorage (variation of cookies) audio & video elements including drawing video on canvas DrawingCanvas element
draw Rectangles
http://faculty.purchase.edu/jeanine.meyer/html5workshop /wkshopdrawing0.html 500,0,default color,20 by0,0, default color, 10 by 20, fill10, stroke
5354HTML5: Detection