Skip to content

Instantly share code, notes, and snippets.

@jdspiral
Created August 18, 2016 14:56
Show Gist options
  • Save jdspiral/3fd5c3837717ca2c77590b9223d36126 to your computer and use it in GitHub Desktop.
Save jdspiral/3fd5c3837717ca2c77590b9223d36126 to your computer and use it in GitHub Desktop.
function fireEvent(element,event)
{
if (document.createEventObject)
{
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent('on'+event,evt);
}
else
{
// dispatch for firefox + others
var evt = document.createEvent("HTMLEvents");
evt.initEvent(event, true, true );
return !element.dispatchEvent(evt);
}
}
function setOption(system){
var obj = jQuery('#attribute225').get();
jQuery(obj).val(system);
Event.observe(obj[0],'change',function(){});
fireEvent(obj[0],'change');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment