Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript event currenttarget

function hide(e){
  e.currentTarget.style.visibility = 'hidden';
  console.log(e.currentTarget);
  // When this function is used as an event handler: this === e.currentTarget
}

var ps = document.getElementsByTagName('p');

for(var i = 0; i < ps.length; i++){
  // console: print the clicked <p> element
  ps[i].addEventListener('click', hide, false);
}
// console: print <body>
document.body.addEventListener('click', hide, false);

// Click around and make paragraphs disappear
Comment

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!">
Comment

javascript event currenttarget

function hide(e){
  e.currentTarget.style.visibility = 'hidden';
  console.log(e.currentTarget);
  // When this function is used as an event handler: this === e.currentTarget
}

var ps = document.getElementsByTagName('p');

for(var i = 0; i < ps.length; i++){
  // console: print the clicked <p> element
  ps[i].addEventListener('click', hide, false);
}
// console: print <body>
document.body.addEventListener('click', hide, false);

// Click around and make paragraphs disappear
Comment

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!">
Comment

PREVIOUS NEXT
Code Example
Javascript :: node get current user 
Javascript :: json_decode javascript 
Javascript :: javascript read text file from url 
Javascript :: input in js 
Javascript :: jquery set multiple options selected 
Javascript :: how to change html element in javascript 
Javascript :: Select radio button through JQuery 
Javascript :: store with redux-thunk 
Javascript :: execute command javascript 
Javascript :: node terminal readline console 
Javascript :: recursive reverse string 
Javascript :: javascript Set Intersection Operation 
Javascript :: regex pattern for password 
Javascript :: find element by object field vuejs 
Javascript :: latitude longitude to km javascript 
Javascript :: JS stack array backwards 
Javascript :: how to check if a string is an integer javascript 
Javascript :: Deploying Node.js Apps on Heroku 
Javascript :: javascript insert div into another div 
Javascript :: average of numbers 
Javascript :: Odoo Plain Javascript files 
Javascript :: react route path exact 
Javascript :: react toastify is not working 
Javascript :: javascript array contains 
Javascript :: Detecting by how much user has scrolled | get how much i scroll in js 
Javascript :: loop node list 
Javascript :: graphql in react 
Javascript :: use $ instead of jQuery 
Javascript :: findone mongoose 
Javascript :: less than or equal to javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =