I found that jquery 1.3.2 has a small problem in IE8.
Recently, the new version of jquery, Version 1.3.2, was used in the project. It is found that this version does not support radio input in IE8 very well, this is what it looks like:
Javascript Code
- VaR_ Val = $ ("Input [name = 'input1'] [checked]"). Val ();
VaR _ Val = $ ("input [name = 'input1'] [checked]"). Val ();
The result shows that the value of _ Val is undefined. At first, I thought it was wrong. Check that there is no problem, in this way, values can be normally obtained in IE6, 7, FF, chrome, opera, and Safari, that is, IE8 does not work. I was puzzled. Later I tried again:
JavaScript code
- VaR_ Val = $ ("Input [name = 'input1']"). Eq (0). Val ();
VaR _ Val = $ ("input [name = 'input1']"). eq (0). Val ();
The value can be obtained, indicating that the problem may occur on the checked attribute of Radio. Try again:
JavaScript code
- VaR_ Val = Document. getelementsbyname ("Input1") [0]. getattribute ("Checked");
VaR _ Val = Document. getelementsbyname ("input1") [0]. getattribute ("checked ");
The values in IE6, 7, FF, chrome, opera, and Safari are true or false, while those in IE8 are empty,
In IE8:
JavaScript code
- VaR_ Val = Document. getelementsbyname ("Input1") [0]. checked;
VaR _ Val = Document. getelementsbyname ("input1") [0]. checked;
It can be set to true or false. I don't know if this is an IE8 bug or does Microsoft have a deep idea?
Last use:
JavaScript code
- VaR_ Val = $ (": Radio [name = 'input1'] [checked]"). Val ();