dropshado.ws

Front-end development minutiæ

by David DeSandro

Archive
RSS feed
Twitter
GitHub Pages mirror

HTML 5 Reference : 3.2.3 Attributes

There are four slightly different syntaxes that may be used for attributes in HTML: empty, unquoted, single-quoted and double-quoted.

This can be useful for escaping quotes in attributes, as seen in this example from the recent jQuery 1.4.3 release notes:

<div data-options='{"name":"John"}'></div>
25 Oct 2010
  • HTML
  • syntax
  • markup
  • desandro.com
  • @desandro
  • github.com/desandro
  • desandro’s JS Fiddles