Skip to content

Instantly share code, notes, and snippets.

@michaelhoang
Last active August 29, 2015 14:04
Show Gist options
  • Save michaelhoang/06d189e45bd02d1bc761 to your computer and use it in GitHub Desktop.
Save michaelhoang/06d189e45bd02d1bc761 to your computer and use it in GitHub Desktop.
Magento fire event prototype in product configurable selection
// Fire event 'change' prototype manual
var element = $(selectorId);
// Create html event
var evt = document.createEvent("HTMLEvents");
evt.initEvent('change', true, true);
// Set value configurable product
element.value = xxx;
// Fire event
element.dispatchEvent(evt);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment