javascript - Getting the DOM element from a JQuery object in IE7 -


i'm attempting dom counterpart of jquery object in order set onclick since ie7 doesn't support .attr('onclick').

however i'm having fair bit of trouble:

var button0 = $('#idelement').next().find('input').get(0); var originalonclick = button0.onclick; var newonclick = function() {     return false; } button0.onclick = newonclick; 

button0 undefined, , i'm not sure why. get(0) should dom element.

<select id="idelement">(bunch of options here)</select> <div>         <input type="button"/> </div> 

var newonclick = function(){     return false; };  var $input = $('#idelement + div input');  $input[0].setattribute('onclick',''); $input.on('click', newonclick); 

jsfiddle: http://jsfiddle.net/tbv7a/


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -