W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2019

Re: [csswg-drafts] [selectors-4] Password reveal pseudo-element and pseudo-class (#3934)

From: Daniel Glazman via GitHub <sysbot+gh@w3.org>
Date: Wed, 20 Nov 2019 16:59:30 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-556103699-1574269169-sysbot+gh@w3.org>
```<html>
  <head>
    <meta charset="UTF-8">
    <title>Input field helpers</title>
    <script>
      function ShowOrHide(aElement) {
        const id = aElement.id;
        // why don't we have a attribute selector for coma-separated lists?
        const field = document.querySelector("[helpers='" + id + "']")
                      || document.querySelector("[helpers^='" + id + ",']")
                      || document.querySelector("[helpers$='," + id + "']")
                      || document.querySelector("[helpers*='," + id + ",']");
        if (field) {
          field.revealed = !field.revealed;
          aElement.src = field.revealed ? "hide.png" : "show.png";
        }
      }
    </script>
  </head>
  <body>
    <input helpers="showButton"
           type="password">
    <input id="showButton"
           src="show.png"
           onclick="ShowOrHide(this)"
           type="image">
    
  </body>
</html>```


-- 
GitHub Notification of comment by therealglazou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3934#issuecomment-556103699 using your GitHub account
Received on Wednesday, 20 November 2019 16:59:32 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:56 UTC