Baseline Widely available
select
ã¤ãã³ãã¯ãããããã®ããã¹ãã鏿ãããã¨ãã«çºçãã¾ãã
ãã®ã¤ãã³ãåã addEventListener()
çã®ã¡ã½ããã§ä½¿ç¨ããããã¤ãã³ããã³ãã©ã¼ããããã£ãè¨å®ããããã¦ãã ããã
addEventListener("select", (event) => {});
onselect = (event) => {};
ã¤ãã³ãå
ä¸è¬ç㪠Event
ã§ãã
<input value="ãã®è¦ç´ ã®ããã¹ãã®ä¸é¨ã鏿ãã¦ã¿ã¦ãã ããã" />
<p id="log"></p>
function logSelection(event) {
const log = document.getElementById("log");
const selection = event.target.value.substring(
event.target.selectionStart,
event.target.selectionEnd,
);
log.textContent = `You selected: ${selection}`;
}
const input = document.querySelector("input");
input.addEventListener("select", logSelection);
onselect ã«ããåçã®å¦ç
ã¤ãã³ããã³ãã©ã¼ã onselect
ããããã£ã§è¨å®ãããã¨ãã§ãã¾ãã
input.onselect = logSelection;
仿§æ¸ ãã©ã¦ã¶ã¼ã®äºææ§
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4