监听 dom 改变
function jt() { //显示 var zw = document.getElementById('s2id_txtCounterName'); if (zw == null) { setTimeout(function () { jt(); }, 30); return; } var zwtxt = zw.getElementsByClassName("select2-chosen"); //设置职务名称 //监听内容改变事件 zwtxt[0].addEventListener("DOMSubtreeModified", function (evt) { var zgxm = document.getElementById("showUserPicker2"); zgxm.innerText = ''; zgxm.setAttribute("val", ''); }, false); }