[whatwg] [WF2] Clear On Focus attribute
Alexey Feldgendler
alexey at feldgendler.ru
Wed May 23 10:23:31 PDT 2007
On Wed, 23 May 2007 19:02:26 +0200, Charles Iliya Krempeaux
<supercanadian at gmail.com> wrote:
>> The field's value shouldn't be abused to achieve this effect because the
>> label is not a value. Stylesheets should be used to get a semantically
>> appropriate piece of information, such as the field's title, to display
>> in the box when the field is empty and has no focus.
> It's true that web developers probably should not be doing this.
> (Since it messes up semantics.) But they are.
>
> So... perhaps we can come up with a way for them to get this effect,
> while preserving semantics.
>
> Maybe a new attribute? "innerlabel" maybe... or something like that.
>
> So, maybe something like....
>
> <input type="search" innerlabel="search in vancouver...">
"Innerlabel" smells a bit of "cellspacing" and "bgcolor". The fact that
the label is "inner" shouldn't deserve a separate way of expression in
markup.
My point is that it's CSS, not HTML, that should be extended to make it
possible to put the label inside the <input>. Something along the lines of:
input[value=""]:not(:focus) { content: attr(title) }
(Currently that would completely replace the input field with static text,
without any chance of focusing the control. Probably there should be
something better than the content property. CSS3 is definitely going to
offer something here.)
--
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com
More information about the whatwg
mailing list