After reading about valHooks in a jQuery defect and more recently seen in a fiddle I searched the jQuery documentation and Google but I can’t find anything other than a short example in the jQuery 1.6 release post. Please can someone explain what valHooks are and why they are useful?
After reading about valHooks in a jQuery defect and more recently seen in a
Share
It is a set of functions that define how to get/set values from DOM elements.
Not all elements can be set using
.value. For example, aselectelement requires something along the lines ofselect.options[select.selectedIndex].value.The underlying code reveals e.g. how to get/set a
selectelement’s value: