var event;if (document.createEvent){event = document.createEvent("HTMLEvents");event.initEvent("change", true, false);document.getElementById("fname").dispatchEvent(event);} else {document.getElementById("fname").fireEvent("onchange")}
http://www.w3school.com.cn/jsref/dom_obj_event.asp