Quantcast

HTML5: Latest Features – Part 2

In a previous article, we discussed some of the important and innovative features of HTML5 that were absent in the previous versions of HTML. In this article, we would discuss some more of those features.

The Output element: the output element is used to display some sort of calculation. For example, if you’d like to display the coordinates of a mouse position, or the sum of a series of numbers, this data should be inserted into the output element.

As a simple example, let’s insert the sum of two numbers into an empty output with JavaScript, when ‘submit’ button is pressed.

This element can also receive a ‘for' attribute, which reflects the name of the element that the output relates to, similar to the way that a label works.

Mark Element: The <mark> element is a sort of highlighter. A string wrapped within this tag should be relevant to the current actions of the user. For example, if you search for “Open your Mind” on some blog, you could then utilize some JavaScript to wrap each occurrence of this string within <mark> tags.

<h3> Search Results </h3>

<p> They were interrupted, just after John said, <mark>”Open your Mind”</mark>. </p>

Pattern Attribute: How often have you found yourself writing some quickie regular expression to verify a particular textbox. Thanks to the new pattern attribute, we can insert a regular expression directly into our markup. Consider an example:

If you’re moderately familiar with regular expressions, you’ll be aware that this pattern: [A-Za-z]{4,10}accepts only upper and lowercase letters. This string must also have a minimum of four characters, and a maximum of ten.

These and other such attributes which are powerful as well as easy to use have made HTML5 most favorite tool for web developers.

Looking for a quality hosting service? here are a few I suggest.
BlueHost | HostGator | Media Temple
Admin
Admin
Ali has been an entrepreneur in web, video and related technologies. Having worked with many business across the globe, Ali stands truly a great pillar in the business working with him.