|
Facts -
HTML and Javascript
|
|
Thursday, 16 April 2009 13:40 |
|
I often use the onchange attribute an HTML checkbox input element to trigger a function each time the checkbox is checked or unchecked:
<input type="checkbox" id="chkThis" value="" checked="checked" onchange="hasChanged(this)"/>
The argument this in the function call refers to the input HTML DOM element. Usually I convert the function argument to a jQuery object inside the function. Today I discovered that in Firefox 3.0.8 the argument will be undefined inside the function if the value attribute is missing.
I am not sure any more whether this is related to jQuery 1.3.2 or to Firefox. It might also be that the value attribute is always mandatory in all input HTML DOM elements and more browsers rely on it.
|
|
Last Updated on Thursday, 16 April 2009 13:58 |