Can I add arbitrary properties to JavaScript DOM objects, such as <INPUT>
or <SELECT>
elements? Or, if I cannot do that, is there a way to associate my own objects with page elements via a reference property?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
In case someone is wondering in 2015, yes, you can - and jQuery is doing just that in data. Just pick future-proof names like vendor prefixes or time-based random suffixes (jQuery).