logo 西林@生存 - 骑猪闯天下!
大小写的ID
2007-9-3 11:34:00 By:xling

很是郁闷,document.getElementById(***)在IE7下可以得到值,但是在FF下却是打死也没有值!
郁闷了老长一段时间,猛然发现我把id的大小写给弄错了,但是在IE7下可以得到。如下例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<a href="http://www.baidu.com" id="BaiDu">百度</a>
<script language="javascript" type="text/javascript">
var bd = document.getElementById("baidu");
alert(bd);
</script>
</body>
</html>

转我的贴,写你的名,是一种可耻的行为!请不要让我BS你!
阅读全文 | 回复(0) | 引用通告 | 编辑

发表评论:

    密码:
    主页:
    标题:
    页面数据正在载入...
<<  < 2008 - >  >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Placard
请职:PHP或JS都行,如果学历要求本科的,请直接忽略。谢谢。 有意者请联系:1fairy1#163.com
Logon System
Search
Info about this blog
Others
myDream
JGrid

数据表格
JTree

树状控件
JMenuTab

标签控件(滑动门)
JTrackBar / JScroll

滑动条/模拟滚动条
JAccordion

(QQ菜单)
关于:
xling,也叫xlingFairy 艾克司令 西林.
Email:1fairy1#163.com
喜欢javascript,喜欢java(汗...还在学习中...水平菜的要死...)
bxna 京ICP备05002321号