Fixed non working onclick event on IE8 and IE9, closes #766