When I have two text fields which listen to change event from one to another, it causes me an error saying too much recursion.开发者_JAVA技巧 Anyone has good solution?
well you can hold a flag that holds the identity of the true event dispatcher. and break the event triggering if it matches.
You added an onchange event listener on both text fields; problem is, changing one text will trigger a change one the other field, which would trigger the onchange result for the first one, etc., resulting in an infinite loop.
精彩评论