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!">
 
PREVIOUS NEXT
Tagged: #currenttarget #javascript
ADD COMMENT
Topic
Name
3+9 =