Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get key from a button in react

const functionCall = (event) => {
    console.log(event.target.getAttribute('a-key'));
}

<button a-key={1} onClick={functionCall}>Press Me</button>

Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript reset form 
Javascript :: How to hthe amount of users online in discordjs 
Javascript :: flatlist scrolltoend 
Javascript :: promise catch 
Javascript :: upload multiple files axios 
Javascript :: convert number to word js 
Javascript :: jquery find div with data attribute value 
Javascript :: rm -rf node_modules 
Javascript :: stomp.min.js cdn 
Javascript :: toggle hook react 
Javascript :: lazy react 
Javascript :: What is the Difference between Undefined, undeclared, Null 
Javascript :: google places autocomplete just cities 
Javascript :: localstorage javascript array 
Javascript :: how to know if a number has a decimal number js 
Javascript :: js check if is array 
Javascript :: 0.1+0.2 javascript 
Javascript :: mongoose schema cast decimals 
Javascript :: javascript sort multidimensional array 
Javascript :: javascript replace hyphen with space 
Javascript :: find and replace value in array of objects javascript 
Javascript :: javascript hashmap 
Javascript :: process env react undefined 
Javascript :: react native floating button 
Javascript :: react-data-table-component api action button 
Javascript :: javascript scroll to top 
Javascript :: axios get data 
Javascript :: for object 
Javascript :: javascript right trim 
Javascript :: react js marked import and use 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =