2012-07-15 74 views

回答

0

你可以訂閱onchange事件的父母,然後清除孩子的值:

window.onload = function() { 
    // the document has loaded => we could access the DOM 
    // we subscribe to the onchange event pf the parent: 
    document.getElementById('parentId').onchange = function() { 
     // and when this event is triggered we clean the child 
     // element value 
     document.getElementById('childId').value = ''; 
    }; 
}; 
+0

謝謝,它的工作原理! – Jenny 2012-07-15 11:01:30