<a onClick="doCheck('mark');"> Mark </a>
If you want to add click functionality to a visible DOM element, it's best to separate the markup from the JavaScript code. Here's an example:
Instead of directly attaching the click handler to the element, you can assign an id to it like this:
<a id="mark">
...
<script type="text/javascript">
$(function() {
$("#mark").click(function() {
doCheck("mark");
});
});
</script>
This approach is preferable because it promotes better code organization. Using jQuery, denoted by the $
symbol, makes it easier to achieve this without unnecessary boilerplate code.