This example is for pure javascript and won't work with React. In React you handle click events with onClick not onclick and pass the function itself (not a function call) in the brackets. So in React it should look like onClick={check} but as I said it's pure javascript example. You can copypaste it in some *.html file and check that it works.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
hi, i started react learning few days ago and have one question.
onclick="check()" i don't understand this, do you need brackets here?
This example is for pure javascript and won't work with React. In React you handle click events with
onClick
notonclick
and pass the function itself (not a function call) in the brackets. So in React it should look likeonClick={check}
but as I said it's pure javascript example. You can copypaste it in some *.html file and check that it works.