I am trying to add an 'onclick' event to a checkbox like so
<input type='checkbox' name="doneTask" value='done' onClick={removeTask(this)}/>
'removeTask' is defined in the same file
function removeTask(elem){
//use elem
}
I want to pass 'this' as argument but the problem is the event gets fired before the click (probably ) because 'removeTask(this)' is seen as a function call. It works fine when I use
onclick = {removeTask}
But I cannot pass 'this' using this method, is there a way to work around this problem?