W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [selectors4] :empty psuedo class and input fields

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 12 Mar 2012 17:54:03 -0500
Message-ID: <4F5E7E8B.6060806@mit.edu>
To: www-style@w3.org
On 3/12/12 2:59 PM, Stefan Wallin wrote:
> Great points! I would love a dynamic attribute-selector since that also
> would solve the specific use case. But unfortunately I still have
> semantic issues with what :empty means for elements which cannot have
> children.

Just to be pedantic, <input> can in fact have children.  Most obviously 
in XHTML, but also in HTML if scripts get involved:

   input { color: green; }
   input:empty { color: red; }
<input value="This text should be green" size="40">
            appendChild(document.createTextNode("Make me nonempty"));

Received on Monday, 12 March 2012 22:54:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:13 UTC