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

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