<!DOCTYPE HTML> <html> <head></head> <form> <input name="a" oninput="{this.form.b.value=10-this.value}" /> <input name="b" oninput="{this.form.a.value=10-this.value}"/> </form> <body> </body> </html>