W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2006

[whatwg] HTML syntax: shortcuts for 'id' and 'class' attributes

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Thu, 30 Nov 2006 16:05:16 -0800
Message-ID: <003d01c714dc$66d452e0$db02000a@internal.toppro.net>
While we are on the subject of discussing HTML syntax....

How about following (wild) idea?

To allow following notation (borrowed from CSS selectors):

<p.myclass>...</p> is equivalent of 
<p class="myclass">...</p> 

<p#myid>...</p> is equivalent of 
<p id="myid">...</p> 

<p.myclass1.myclass2>...</p> is equivalent of 
<p class="myclass1 myclass2">...</p> 

<p#myid.myclass1.myclass2>...</p> is equivalent of 
<p id="myid" class="myclass1 myclass2">...</p> 

It is syntax sugar of course but at least it will reduce amount of data 
needs to be sent over the wire.

Andrew Fedoniouk.
Received on Thursday, 30 November 2006 16:05:16 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:50 UTC