Earlier, I answered a question which has subsequently been put on hold as off-topic. At the time, I would not have considered that it would be put on hold as the OP had at least made some effort to include what they had tried.
However, my question relates to this comment (along with a down-vote on my answer) Trying to log to console with onclick event
Too bad because of this answer the question will not be deleted..
Since this was only a syntax problem which could have easily been found online with a quick search, I can now understand why this has been put on hold...
So, should I just delete my answer so that the question can be deleted?