Rethinking Forms in HTML5

Rethinking Forms in HTML5

Tutorial Details
  • Technology: HTML5
  • Difficulty: Moderate
  • Estimated Completion Time: 30 Minutes
This entry is part 9 of 14 in the HTML5 and You Session
« PreviousNext »

While there are many changes for the better in the HTML5 specification, there is no better bang for the buck for the data driven website than the transformation of forms. These simple changes will transform how you enter, validate, process, and even display inputs. You will be able to create more usable web applications with less code and less confusion.


Introduction What’s in Store?

“In the recent past, the majority of innovation in forms have come from the use of JavaScript, rather than old fashioned HTML. While there is nothing wrong with using JavaScript to enhance forms, it does bring its own usability along with many development headaches.”

HTML 5 is still undergoing changes before it is finalized. If you look at the spec, you will see that there is still a last call for comments along with statements, such as, Implementers should be aware that this specification is not stable. Furthermore, particularly for the purposes of this tutorial, focusing on the changes to forms, browser implementation is spotty to say the least. That said, the changes on the horizon are worth examining today. While the changes are major in scope, the implementation for developers look to be rather easy. In this tutorial, we will take a high level overview of these ground breaking changes, and think about how they will impact the nature of user input.

In the past, changes to forms have been relatively minor. If you go back to the HTML 3.2 spec, which was finalized in 1997, you will see the same basic form inputs that you use today. Select, textarea, radio, checkboxes and text were available then. A generation of web developers have grown up writing to these same standards. While later versions of the specification brought changes to forms, such as the fieldset, label, legend, and form actions such as onsubmit or onchange, the way we deal with user input has remained somewhat static. In the recent past, the majority of innovation in forms have come from the use of JavaScript, rather than old fashioned HTML. While there is nothing wrong with using JavaScript to enhance forms, it does bring its own usability along with many development headaches. For instance, there are many different ways that we can validate forms using JavaScript, but what happens when a user does not have JavaScript enabled? We further have to apply logic to our server side scripts. In the end, we have a not so consistent way of handling user input. HTML 5 doesn’t address every innovation headache for forms in the past 13 years, but it does give us plenty of tools to
make our jobs much easier, and allows us to produce much more consistent forms.

There are three basic changes that we should examine. First, we will look at the changes to the input elements, such as autocomplete or autofocus. The second is changes to the input states, and there are quite a few! Finally, we will examine the new form elements. It is important to restate that the specification is in flux; so I wouldn’t be surprised if, in the future, there are subtle changes to what we are discussing. That’s what makes this fun!


Changes to Input Elements: A Whole New Playground.

Input attributes are those items that you place in inputs to explain what the input is doing. For instance:

    <input name="form_text" id="form_text" type="text" value="foo" size="10" maxlength="100">

In the example above, the input attributes are value, size, and maxlength. These have been around for quite some time. HTML 5 doesn’t change the concept of having input elements, but rather adds quite a few more. There does appear to be at least one subtraction, or rather substitution, and that is the change of disabled now appears to become readonly. The spec does not go into detail to the change, but if I was a betting man, the change would allow event handlers, such as onblur, to fire – which a disabled element prevents.

The new attributes include autofocus, autocomplete, list, required, multiple, pattern, min and max, step and placeholder. I think of these as two different flavors of elements. The first flavor enhances the experience for the user, while the second enhances the development experience. What I mean by this, is autofocus, autocomplete, list, multiple, and placeholder helps the user experience in selecting items, or perhaps by giving a description of what the form input is looking for, or by aiding in completing the form. required, min and max, pattern and step add to the development experience by saying what should be in the form itself.

Autofocus

What each of these new attributes do is relatively easy to understand. For instance:

    <input name="form_text" id="form_text" type="text" value="foo" autofocus>

Above, the autofocus element focuses the text input on page load. This means that as soon as the page loads, this text input is ready to take an entry. You can start typing right away, as this element has the focus of the document. Something that we used to do in JavaScript in a line or so, can now be done with a single word.

    <input name="form_text" id="form_text" type="text" value="foo" autocomplete="off">

In the above example, by turning off autocomplete, you keep the browser from filling in the form field from a previous value. Nothing bugs me more than seeing my credit card number come up in a form as soon as I type a digit. The default for autocomplete is to be on, so the only time you need to use this element is when you want to prevent the form field from completing from previous entries. It adds to the user experience by keeping sensitive information from just “popping up.”

List

    <input name="form_url" id="form_url" type="url" list="url_list">
    <datalist id="url_list">
        <option value="http://www.google.com" label="Google">
        <option value="http://www.nettuts.com" label="NetTuts">
    </datalist>

The list attribute is very cool. Essentially, you provide a datalist, and it will create a drop down from your text input. Think of it as a natural auto complete. Take it a bit further, and instead of having to add a JavaScript library for a quick look up, based on key entries, you could easily just add an “onchange” event handler, with an AJAX post, and you end up with a drop down that gets more specific as the user types into the box. With HTML 5, this functionality an be created with just a few lines.

Multiple

<input name="form_url" id="form_url" type="url" list="url_list" multiple>

The multiple attribute allows you to select multiple items from your datalist. For instance, you might have a form which sends messages from your website. By using the multiple element, you can allow the user to select multiple recipients to send that message. Again, this is something we can accomplish with a bit of JavaScript now, but with HTML 5, we only have to add a single command to the form.

Placeholder

    <input name="form_text" id="form_text" type="text" placeholder="Type Here">

The placeholder attribute is something we have been doing for years with a touch of JavaScript. What this does is, as soon as the input is focused, Type Here will vanish. If there was no change to the text on blur, then Type Here will reappear. Once again, we are taking some JavaScript out of the picture to enhance the user experience.

Required

These next new attributes all enhance our development. With the exception of “step,” each aids in the validation of the user input.

    <input name="form_text" id="form_text" type="text" value="foo" required>

The required attribute is exactly as it sounds. I, the developer of this webpage, require you to fill out this form prior to hitting submit. This is the basic form validation that we use today with JavaScript. What took a library before to add a required entry, now takes a single word in the form.

RegEx

    <input name="form_text" id="form_text" type="text" value="foo" pattern="[0-9][A-Z]{3}">

Of all the new form attributes, this is the one that I am most excited about. Mr. Form, let me introduce you to my good friend, Regex. Thats right, we can validate form entries based on regular expressions. While this one is going to be mystifying at first, as you learn regular expression, the possibilities of validation now become limitless.

Validation

    <input name="form_range" id="form_range" type="range" min="1" max="10" step=".5" value="5" >

I have lumped the final three into one example, as they all deal with number validation – or the range of numbers that we can include.

  • Min: is the minimal value that an input will take.
  • max: is the maximum input value the input will take.

Each of these are dealing with numerical values. Dont confuse them with maxlength, which deals with the number of characters an input will take. The step element is just as it sounds. As you select a numerical value, step it up by .5 or down by .5 — meaning this input type will have the possible values of 1, 1.5, 2, 2.5, and so on.

As of right now, to the best of my knowledge, browser support is somewhat spotty on these attributes. Heres a quick chart showing what I was able to find on the implementations.


Changes to Input Types: A Whole Lot of Love.

There are eight new input types, not counting all the new date and time types, which for our purposes, I am lumping into one. Its important to note that the browsers which have not implemented the new input types will degrade to a type of text on each that I have tested. What the new input types bring is an ability to validate user input based upon the type that you are using. There is also more validation to come which I will be discussing in the next two sections. Each of the new input types allows us to separate from a text field to something more specific. For instance, to take integer or float values prior to HTML 5, we mostly used an input type of text. Just from the annotation, it is counter intuitive for beginners. By being more specific, we then have better visual control over our interface, as the more specific the element in HTML, the greater control you have from within the CSS, and the easier it is to define those visual elements. In addition, with the new specific input types, browsers are now able to fine tune what the input range should be. Finally, with the advent of mobile computing, we are able to make web application form elements which can be styled to look like natural applications, or can shape the keyboard that we are using.

Let’s look at number handling first:

Numbers, Integers and Floats

    <input name="form_range" id="form_range" type="range" min="1" max="10" step=".5" value="5" >

    <input name="form_number" id="form_number" type="number" min="1" max="10" >

Each of these input types allows us to play with numbers, and when we post the forms, we should be sure that we have those float values for our server side processing without the added JavaScript validation. Simply put, for each of these types, we are expecting to get numbers back within the range that we define and with the step that we want. The difference between the two types is how they are displayed. While I am waiting to see implementation on the number type, I would expect either a roll, or a text box, or possibly a type of a select with numbers. The range type is a bit different, in that it looks like a sliding value, similar to what you would expect to see for a volume control.

Dates and Times

    <input name="form_date" id="form_date" type="date">

    <input name="form_month" id="form_month" type="month">

    <input name="form_week" id="form_week" type="week">

    <input name="form_time" id="form_time" type="time">

    <input name="form_datetime_local" id="form_datetime_local" type="datetime-local">

Another big relief to standardize your backend development is the new date and time input types. From the Opera implementation that I have seen, each shows a calendar drop down, which allows your user to select a date. Again, we can validate on our webpage that the input is in the format that we are expecting. Each does exactly what you would think; you are selecting a month, week, day, or time. The one that is a little different is the datetime-local, which is showing the date and time without your timezone offset. For instance, if you are selecting a flight, the datetime-local would show the time and date in the city that you are going, which is not necessarily the timezone that you are currently in.

Urls, Emails, Telephone, and Color

    <input name="form_url" id="form_url" type="url" list="url_list">
    <datalist id="url_list">
        <option value="http://www.google.com" label="Google">
        <option value="http://net.tutsplus.com" label="NetTuts+">
    </datalist>

    <input name="form_email" id="form_email" type="email" list="email_list" multiple>
    <datalist id="url_list">
        <option value="jane.doe@test.com" label="Jane Doe">
        <option value="john.doe@test.com" label="John Doe">
    </datalist>

    <input name="form_telephone" id="form_telephone" type="telephone">

    <input name="form_color" id="form_color" type="color">

Each of these input types are descriptive. The URL and Email types both have the validations of valid url patterns and valid email patterns. The telephone does not, however, conform to any specific pattern. It just strips line breaks. If you want to enforce a validation pattern on the telephone field, you can always use the pattern element. Each of these elements minus color will also take the list attribute, minus color. Color is the oddball of the bunch; I can see its practical use, where you can select a color from a fancy pull down that shows colors, and enforce the text entry of something like #000000, but it doesn’t really fit the rest of the changes, in my opinion. Its like playing which one is not like the others.

Like the attributes, the input type browser implementation is quite spotty. My iPhone seems to support more of these than Safari, which is a bit funny to me. This is the best that I could find, as to support.


Changes to Form Elements: Not Quite as Drastic

The number of changes to the form elements is not as drastic as input attributes and types. That said, there are a few new elements to be aware of. We have already covered datalist – it is how we define what will be selected from a list element call – but we haven’t seen keygen, output, progress, or meter. Outside of keygen. these aren’t quite as self explanatory as the new attributes. Lets dig into these just a bit.

Keygen

    <keygen name="key">

This one is a bit confusing. It does not generate a public key for you. Instead, it is a key pair generator control. Once the form is submitted, it packages the key pair to store the private key in the local key store, and sends the public key back to the server. It will generate the client certificate and offer it back to the user to download. Once downloaded and stored with the private key, you can then authenticate services, such as SSL or certificate authentication.

Output

    <input name="number_1" type="number"> + <input name="number_2" type="number"> =
    <output onforminput="value = number_1.valueAsNumber + number_2.valueAsNumber"></output>

Think of the output element as a text area on steroids. What you can do is calculate from two number type text inputs and output that calculation without ever submitting the form back to the server. If you just return false onsubmit, in the above example, it will calculate number_1 plus number_2, and provide you the answer. Like many things discussed in this tutorial, this is something that we can accomplish today with JavaScript, but this really lessens the amount of code that we need to write in the future.

Progress and Meter

    <progress id="p" max=100>0% </progress>

    <meter min=0 max=20 value=12 optimum=10>12cm </meter>

The final two new elements are progress and meter. They are similar, but with one difference. Progress is meant to be used to measure the progress of a specific task. For instance, if you might have five more pages to complete before a survey is done, you would show the progress element in that area. The meter, on the other hand, is a measurement of something. You might want to show the remaining disk space a user has left. You would use the meter to display that measurement. There are new boundary elements, such as low, high and optimum. These supersede the min or max elements; so if they exceed them, they become the new lower and upper limits of the form.

Like the rest of the HTML 5 form changes, browser implementation is poor at the moment. Heres what seems to work, and what doesn’t (at the time of this writing).


Conclusion

From what I can see, there is no reason to not start using HTML 5 forms. The input elements and types all degrade nicely, even in IE6, where they are either ignored as elements, or degraded to text inputs. We are going to have to wait a while for the validation attributes to become a reality, but with that said, there are still some uses today without those advantages. For instance, the iPhone modifies the keyboard if you are using the url, email, or number types. The range input type is already supported in WebKit browsers, so you could be the first kid on the block with a number slider that works without JavaScript. The spec is rapidly finalizing, and browsers are catching up rather quickly to the paradigm shifts. There is no time like the present to at least begin playing with these new toys! What do you think?

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.html5laboratory.com Ian Devlin

    I completely agree with your conclusion in that there’s no reason not to start using these new HTML5 form elements. They all fallback nicely on browsers that don’t support them, so you might as well do it now and allow your forms to take advantage of the new functionality in the future when the browsers start to support them.

    • http://mu5ic.me MU5IC.ME

      By the time enough browsers support this, your forms/web pages will have changed anyway, and the specification or implementation might have changed as well.

      As developers we get excited about new stuff, and that’s the way it should be, but there’s no rational reason to use the above features on live pages yet.

  • Callum

    Interesting article.Just thought that I should point out that the HTML5 “validation” techniques such as “required” and “regex” should also be used in combination with server side validation as anyone with firebug will be able to remove the html5 validation techniques.

    • http://scott-christopherson.com Scott Christopherson

      Most definitely. These inputs reduce client-side validation code, but server-side should be just the same as it’s always been. I was hoping this would be mentioned in the article, but alas, it wasn’t.

    • http://www.pixelfuelmedia.com/ Johnny

      Good point. With the growing number of browser plugins available that can manipulate a page’s functionality, we as responsible developers should never let client side code replace server side code.

  • http://spotdex.com Davidmoreen

    I don’t know about anyone else but I am rather excited about this. The more developers can reduce the use of javascript for the smaller things, the better.

    But… I think that if someone has an HTML5 browser changes are they have javascript on, still…

    • http://xpressabhi.com abhishek

      I agree with you Dav , less use of javascript will reduce the page load time which will make difference on google ranking. I am collecting other similar great HTML5 article at one place on my blog.
      You can have a look around.

      • http://newarts.at Drazen Mokic

        The “page load time” is soooo a small thing for google, unfortunately many people take it too serious. You should optimize your page and your page loading time for your visitors in first case, not for google.

        The real advantage i see in using less javascript is in browser performance.

      • Patrick

        What? Page load is important for google? That’s absolutely new to me.

        In fact: The time to load a web page has NOTHING to do with the pagerank on google. It’s JUST a tip from google to speed up your website, not a requirement to get a high pagerank. Okay, it MIGHT have a really small effect on your pagerank, but its so small, that you could really ignore it.

        Do you know why? Try out your website with Lynx. This is, how google see your website. Google doesn’t load any javascripts – like the Lynx browser.

      • http://jonpiehl.com JonP

        Google does incorporate site speed when determining page rank. However, it doesn’t effect most websites. I’m guessing it only effect sites that are really slow. One of Google’s goals is to get users away from Google search as quick as possible. And if your page takes forever to load then that goes against that goal.

        Read this post from Matt Cutts (Googler)
        http://www.mattcutts.com/blog/site-speed/

      • http://montanaflynn.me Montana Flynn
    • Hieu Vo

      Besides using html5 attribute, you have to use javascript to make sure it works well on browsers which do not support html5 … anyway, it’s worth trying :))

  • http://pariwar.info Developnew

    Very good article…thanks for sharing… hope we’ll use it in all browser… :)

  • Tanmay Joshi

    Thanks for the great stuff :)

  • Mini0n

    Awesome!

  • http://www.webstandards-magazin.de Webstandards-Magazin

    Your example for “multiple” is missing the multiple-attribute inside the input-tag. But anyway: Great summary on what’s new with forms in HTML5. Good work!

  • http://ds.laroouse.com piyanistll

    very nice tutorial thanks lot

    • DC

      i just <3 Design Source

  • http://www.gregbabula.com Greg Babula

    I’m also really excited about this

  • Ian

    The datalist one is pretty cool. I’m looking forward to trying it out.

  • Colin Robertson

    Good introduction to these. I knew HTML was hoping to add these sort of things but hadn’t heard any of the detail. The validation examples seem to cut out a lot of manual work that is required just now.

    If these things are built in without having to do any JS then ideal. It will hopefully mean we can concentrate on more interesting development, rather than recreating this for every form we build.

    What needs to happen next though is all the browsers need to start supporting this stuff. If I’ve got to write it so that one browser can get this functionality I might as well do it for them all.

  • http://www.thatdeadpixel.com Mike

    These are going to be fantastic additions, I’m really excited about them. They seem rather simple and “drama free”, so I wonder why it has taken so long for them to be implemented in browsers…?

  • TVorace

    Seems you miss the “multiple” attribute

  • http://www.philohermans.com Philo

    Thanks for this great article.
    Love the new HTML5 form features! :)

    I just hope that IE doesn’t walk behind like usual.

  • http://www.corymathews.com/ Cory

    Nice little summary article. It mainly just show Opera FTW! That support is amazing.

  • http://moscreative.com Serhiy

    Really good tut!

  • http://www.deluxeblogtips.com Rilwis

    HTML5 form elements are awesome, but I think we aren’t ready yet to use them. Not all browsers support them, even they don’t support the same elements as well. Yes, we can start using HTML5 right now, but just for some basic tags. If we need more, I think Javascript is still better.

  • Abhijit

    Very good article, learned a lot about the new HTML5 form elements. Its surprising to see that Presto has gone ahead of Gecko and Webkit in terms of support for HTML5.

  • http://www.jakswebdesign.com Adam

    Wow, these features are fantastic for the developer, to say the least. Thanks so much to the author for stepping through all of them with us. Can’t wait until there are more checkmarks than X’s in what engines support what features.

  • Marc

    HTML should have had some features like this years ago. Anything that adds to the usability without relying on a two-tier system (JS, in other words: most people can use it, while some cannot) is welcomed by me.

    Given the state of the HTML5 spec, I can’t really blame the browser developers for the current lack of support, though. Continental drifts move more rapidly than the W3C.

  • Wyverald

    Thanks for the article. One small thing though: AFAIK WebKit supports the placeholder attribute.

  • http://www.alastairdewar.co.uk/ Alastair Dewar

    Great article, thanks.

    Good informative insight into how to use these new tags and make the most of what modern browser engines have to offer without the overhead of buggier javascript.

    Lets hope we see increased support over the coming months.

    Alastair

  • http://webgyani.com Arnab C

    Thanks for the great in-depth article, but I think the “placeholder” attribute is supported in Webkit but in your browser chart it is showing as not supported, in fact this was first introduced in Safari and this is also available in Chrome as well.

  • Darren

    Don’t forget to use server side validation too guys; any developer who is using firebug could easily edit the code and bypass that type of form.

  • Radu

    These changes are very welcome… too bad it will take a while until we can fully use them, given our dear old friend Internet Explorer…

  • http://people.opera.com/danield Daniel Davis

    You say you are waiting to see an implementation of the number input type. Please try Opera (disclaimer: I work for them) as shown here:
    http://people.opera.com/brucel/demo/html5-forms-demo.html

  • http://brianswebdesign.com Brian Temecula

    Wow, I’m pretty happy with what you have shown us. While we will still have to validate post data server-side, it looks like much of what we used to have to do with javascript is going away! Not that I don’t like javascript, but this is so much easier!

  • Kyler IE Team

    Thanks for this great post! We liked it so much we put it up on the IE Twitter!
    http://www.twitter.com/IE

    Cheers,
    Kyler
    IE Outreach Team

  • http://www.sonaliagrawal.com Sonali Agrawal

    I am just too excited to start implementing in my projects. This is definitely going to be make development so easy. Will have to be patient though.

  • http://www.twmerge.nl/ iScripters

    It’s really cool and stuff, but there are tools that lets you edit the HTML for the website you’re viewing. So you can also edit the pattern and required etc.
    So much for validation…

    • mike

      nice tutorial

  • http://wyome.com John Cox

    I think it boils down to how the browsers implement the validations, and other cool features. If they do it like maxlength where the form will only take what is wanted, and then stop, then no biggie. My main question is how to you tell the user that this is wrong, re-enter? That’s what I struggled with when writing this, as I am going from the specification with no real implementations as of yet.

    It could be a combination of needing a “output” element to display, etc. I didn’t catch anywhere in the spec, although I could have easily missed it, somewhere to display / trap the validation errors. It could well be that you would need js turned on to trap those errors in some browsers.

    This is all the spec has on the subject:

    “Forms can be annotated in such a way that the user agent will check the user’s input before the form is submitted. The server still has to verify the input is valid (since hostile users can easily bypass the form validation), but it allows the user to avoid the wait incurred by having the server be the sole checker of the user’s input.”

    It will be fun to watch the browser implement though. Just my thoughts.

  • Jarrid Bainbridge

    I am very excited about HTML5. But until there is better browser support for it – I just do not care enough to want to start implementing it.

  • MojoMark

    Thanks for the info.. I’d love to do these now but I’m in one of those dinosaur companies where IE6 is still rampant – the desktop support teams won’t force the upgrade due to three apps that won’t work in “modern” browsers.

    I think you may have a copy/paste typo though.. Line 8 in the example for “Urls, Emails, Telephone, and Color” should give the id list as “email_list” not “url_list”

  • http://tutorialswalk.info Abhishek Bhardwaj

    I usually don’t comment on tutorials, but was forced to do it on this one! It was nice & informative :)

  • http://www.paulouano.com/ Paul

    For the tag, onforminput=”value = number_1.valueAsNumber + number_2.valueAsNumber” is in Javascript, right? Can we also use getElementById() instead of number_1 or number_2 ?

  • http://www.iconfinder.com Martin LeBlanc Eigtved

    I can’t wait until HTML5 is supported by most browser. This stuff is fantastic for both the users and developers.

  • khaled

    Thank you , really good stuff!

  • http://clip-bucket.com Arslan Hassan

    Well…
    i must say,

    WHAT A GREAT LIFE WE ARE GOING TO HAVE IN FUTURE ^-^

    but how GECKO and TOOLKIT is beaten by PRESTO >O

    anyways, IT WAS A SUPERB POST…

  • http://thinbox.org/~mikol Mikol Graves

    Nice synopsis of the upcoming features. But I think the following sentence is technically incorrect.

    “Take it a bit further, and instead of having to add a JavaScript library for a quick look up, based on key entries, you could easily just add an ‘onchange’ event handler, with an AJAX post, and you end up with a drop down that gets more specific as the user types into the box.”

    FWIW, “onchange” isn’t the right event to handle if you’re interested in key strokes. “onchange” is only triggered after the field loses focus if the value of the input has changed. Use “onkeypress” to handle key strokes.

  • Ramesh

    Sounds good!

  • http://bcncode.net/blog Juanjo

    The complexity on writing web pages is increasing every day… another variable to take into account. We really needed a new “standard”?

    Anyway, thank you very much for this information, good job.

  • http://www.it-blocks.com Abdelrahman Elghanam

    Great Summary … just wanted to know when we should be expecting “HTML 5″ to be Official & supported ??

    Thanks again…

  • http://net.tutsplus.com/tutorials/html-css-techniques/rethinking-forms-in-html5/ Say

    Thanks, the tutorial is good, I would like more information about this because I’m currently making a website and I need all the help possible to make it better and implement the most updated technology.

  • Adil

    Cool, I also believe that since Html 5 will also be used by google as a ans to flash and silverlight, lets see what will happen.

    Nice post dude.

    Regards,
    Adil

  • http://aeonbeat.net Martin

    Forms became a world on its own :)

  • http://www.lautr.com hannes

    very nice’n useable :D

  • http://www.onuronaran.com.tr Onur

    Forms became a world on its own

  • http://codendesign.blogspot.com nXqd

    HTML5′s form is really nice . It covers a lot of javascript work these days :)
    And I’m impressed that Presto is always the best as standard

  • http://codendesign.blogspot.com nXqd

    It looks like when they talk about command line . They all think about linux :) . I think PowerShell in windows is a big step in command line enhancing from microsoft :)
    They’ve some commands like unix ( which map from it’s old command ) like ls, cp, …

  • http://www.dev-hq.co.uk Joe

    You make some good points.

    It’s definitely worth thinking about starting using these types of things (especially since they fall-back fine to unsupported browsers anyway).