Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Tuesday, January 7, 2014

input type=“submit” Vs button tag are they interchangeable?

Buttons created with the BUTTON element function just like buttons created with the INPUT element, but they offer richer rendering possibilities: the BUTTON element may have content. For example, a BUTTON element that contains an image functions like and may resemble an INPUT element whose type is set to "image", but the BUTTON element type allows content.
So for functionnality only they're interchangeable!
(Don't forget you have to use type="submit" with button too.)

Monday, September 9, 2013

role attribute in html

As I understand it, roles were initially defined by XHTML but were deprecated. However, they are now defined by HTML 5, see here: http://www.w3.org/TR/wai-aria/#roles
The purpose of the role attribute is to identify to parsing software the exact function of an element (and its children) as part of a web application. This is mostly as an accessibility thing for screen readers, but I can also see it as being useful for embedded browsers and screen scrapers. In order to be useful to the unusual HTML client, the attribute needs to be set to one of the roles from the spec I linked. If you make up your own, this 'future' functionality can't work - a comment would be better.