Accessing the 'type' property on VML elements fails on IE. Fixes #7071.

This commit is contained in:
John Firebaugh 2011-04-12 16:48:22 -04:00 committed by John Resig
parent 3418f32387
commit 0d8b247cab
3 changed files with 10 additions and 2 deletions

View file

@ -800,7 +800,7 @@ if ( !jQuery.support.changeBubbles ) {
beforedeactivate: testChange,
click: function( e ) {
var elem = e.target, type = elem.type;
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
testChange.call( this, e );
@ -810,7 +810,7 @@ if ( !jQuery.support.changeBubbles ) {
// Change has to be called before submit
// Keydown will be called before keypress, which is used in submit-event delegation
keydown: function( e ) {
var elem = e.target, type = elem.type;
var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||