I have several buttons whose SRC is toggled each time they are clicked. This is accomplished by:
//deactivate activate click handler var destroy = function() { $(this).unbind('toggle').unbind('click'); }; var init = function() { $(this).toggle(function(e){ var $this = $(this); $(this).attr("src","images/btnReactivate.gif") }, function(e) { $(this).attr("src","images/btnDeactivate.gif") }); }; $("img.active_toggle").livequery(init,destroy); I'm using livequery to rebind because there is some ajax involved elsewhere. Basically i have a dynamic table. Each row contains one image. My code finds an associated input field and checks the value. If the value is False, find the img in that row and toggle the src $("#tblFormulary tr").each(function(){ if ($(this).find("input[name $='useThisRecord']").val()=="False") { $(this).find('img').toggle(); } }); Must be missing something here because this does nothing. Maybe I need to simulate a click instead?