开发者

IE8 doesn't set value of an input

I some divs with forms inside of them and i do have inputs with same ids but in different divs and forms so do like this:

$("divEdit form #ParentId").val(12);

it works on chrome/mozilla but not on开发者_如何学JAVA IE8

anybody knows why ?


You can't have multiple elements with the same id on the same web page. You'll need to use some other method of identification such as a class (or with form controls the same name).


ID attributes must be unique in web pages. It's part of the specification and you will always run into issues using the same id more than once.

http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜