- javascript: How to clean an input box when another input value changed?
- 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 = '';
- };
- };