Skip to content

Attribute selectors and client-side validation #96

@shapeshifta78

Description

@shapeshifta78

Hi there,

I ran into the following problem today:
input[type="text"] { border: 1px solid grey }
input.valid { border: 1px solid green }

According to CSSLint the input-tag in front of the valid class is bad code. I put the input in front of the attribute-selector because it is needed for good css-performance.

CSS-Lint does not bother with the input in front of the attribute-selector but tells me, that the tag in front of the class selector is bad.
I do understand this rule and I tend to agree, but how are we supposed to do correct client-side validation without having to use inline-styles via js which is not according to good js-maintainability?

Best regards,
Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions