JSFiddle - React, Tailwind, and code Playground

by Vasil Svetoslavov

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<img src = "http://dummyimage.com/120x90/f00/fff.png&text=click_me" />

JavaScript

$('img').click(function() {
    alert("bound first, but executing second");
});

$('img').bind('click',function() {
    alert("bound second, but executing first");
});

var clickHandlers = $('img').data('events').click;

var newHandler= function(evt) {
	alert('oops');
  evt.stopPropagation();
  evt.preventDefault();
  return false;
}
clickHandlers.splice(0, 0, {data: null, guid:null, handler: function(evt){
	alert('oops');
  evt.stopPropagation();
  evt.preventDefault();
  return false;	
} });
console.log(clickHandlers);

//clickHandlers.reverse(); // reverse the order of the Array