The CSS input[value=whatever] selector doesn't seem to match against input.value. What am I missing?

前端 未结 2 1614
逝去的感伤
逝去的感伤 2021-01-27 17:04

N.B.: I should note that the proper solution to this is to just use the \'placeholder\' attribute of an input, but the question still stands.

Another N.B.: Since, as Qu

2条回答
  •  醉话见心
    2021-01-27 17:25

    The value attribute sets the default value for the field.

    The value property sets the current value for the field. Typing in the field also sets the current value.

    Updating the current value does not change the value attribute.

    Attribute selectors only match on attribute values.

提交回复
热议问题