Which technique is better:
<span onclick="dothis();">check</span>
or:
<span class="bla">check</span>
<script type="text/javascript">
$('.bla').click(function(e) {} );
</script>
Are there any differences according to usability, performance etc.?
Thank you!
The second is better from a code quality standpoint since it is considered to be unobtrusive. I am not certain if either approach has measurable performance benefits.
My advice is to stick to the unobtrusive approach – it will save you a lot of time when you are doing maintenance down the road.