Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. javascript: How to clean an input box when another input value changed?
  2. window.onload = function() {
  3.     // the document has loaded => we could access the DOM
  4.     // we subscribe to the onchange event pf the parent:
  5.     document.getElementById('parentId').onchange = function() {
  6.         // and when this event is triggered we clean the child
  7.         // element value
  8.         document.getElementById('childId').value = '';
  9.     };
  10. };