Remove onclick function call w/jQuery
<p>I have an icon on a page, what when clicked is calling a function from an external JS file.</p>

<pre><code>&lt;input type="checkbox" checked="checked" id="myCheck"/&gt;

&lt;img src="icon.png" id="myIcon" onclick="myFunction)(this,null,null)" /&gt;
</code></pre>

<p>I need to add a functionality to disable this click when a checkbox is checked, and allow click and calling the JS function if the checkbox is not selected. </p>

<p>Tried this but it does not seem to work. What am I missing?</p>

<pre><code>$("#myCheck").prop("checked", true).click(function(event){
  event.stopPropagation();
});
</code></pre>

<p>UPDATE: since I do not have much control over code that is not in the header in this particular case, and can not remove  onclick="myFunction)(this,null,null) from img tag, is there still a way to disable click action if the checkbox is selected. Perhaps I can remove HTML. What would JS be considered here? It's not an attribute...</p>
