Re: [csswg-drafts] [selectors] pseudo selector to match forms ValidityState

Just for the shake of it i wrote a jQuery.expr

```js
$.extend($.expr[':'], {
  validity: (node, i, args) => 
    args[3]
    .replace(/-([a-z])/g, g => g[1].toUpperCase())
    .split(',')
    .some(prop => node.validity[prop.trim()])
})
```
```js
$('input:validity(value-missing)').css('color', 'red')
```

-- 
GitHub Notification of comment by jimmywarting
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1525#issuecomment-309008468 using your GitHub account

Received on Friday, 16 June 2017 11:58:51 UTC