- From: Daniel Glazman via GitHub <sysbot+gh@w3.org>
- Date: Wed, 20 Nov 2019 16:59:30 +0000
- To: public-css-archive@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