Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Using $(this).previous in the onclick handler can lead to errors if other JS is manipulating the DOM structure. #10

Open
leecunliffe opened this issue Aug 25, 2010 · 0 comments

Comments

@leecunliffe
Copy link

For example, In one form I use LiveValidation to validate the dates. This JS creates a span after the input. Then when I click to launch the date picker, the JS errors because $(this).previous is the span and not the expected input element.

Solution: use the unique ID to identify the input field.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant