Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

currenttarget javascript

//Javascript
document.getElementById("foo").onclick = (e) => {
	e.target.style.backgroundColor = "#333";
	console.log(e.target.value)
    
    // Expected Output: "Hello World!"
}

//HTML
<input id="foo" type="text" value="Hello World!">
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #currenttarget #javascript
ADD COMMENT
Topic
Name
1+8 =