Answers for "onclick for a tag react"

0

onclick inline function react

//Inline onclick function
<button onClick={(e) => console.log(e)}>
        Click me
</button>
Posted by: Guest on January-28-2021
4

onclick react

function ActionLink() {
  function handleClick(e) {    e.preventDefault();    console.log('The link was clicked.');  }
  return (
    <a href="#" onClick={handleClick}>      Click me
    </a>
  );
}
Posted by: Guest on November-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language