手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >IE/火狐/Chrome操作display:none对象所遇问题解答
IE/火狐/Chrome操作display:none对象所遇问题解答
摘要:下面,先来段简单的测试代码[code]不要被闷了document.getElementById("hh1").value="11111";d...

下面,先来段简单的测试代码

[code]

<SPAN><!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" lang="zh-CN">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>不要被闷了</title>

<body>

<input type="text" id="hh1" value="2">

<input type="hidden" id="hh2" value="2">

<input type="text" id="hh3" value="2">

<div><input type="text" id="hh4" value="2"></div>

<script>

document.getElementById("hh1").value="11111";

document.getElementById("hh2").value="11111";

document.getElementById("hh3").value="11111";

document.getElementById("hh4").value="11111";

var strall="h1="+document.getElementById("hh1").value;

strall+=",h2="+document.getElementById("hh2").value;

strall+=",h3="+document.getElementById("hh3").value;

strall+=",h4="+document.getElementById("hh4").value;

alert(strall);

</script>

</body>

</html></SPAN>

[/code]

接着上三张在IE、火狐、Chrome浏览器调试工具显示的源代码中结果图

******************************IE开发人员工具显示的源代码***************************************

IE/火狐/Chrome操作display:none对象所遇问题解答1

******************************Firebug工具显示的源代码***************************************

IE/火狐/Chrome操作display:none对象所遇问题解答2

******************************chrome开发人员工具显示的源代码***************************************

IE/火狐/Chrome操作display:none对象所遇问题解答3

其上代码执行结果都是一样的,如下图:以后不要被闷到了!如果是开发工具显示设置问题,或者编写什么兼容代码等,还望留言,感谢感谢!

IE/火狐/Chrome操作display:none对象所遇问题解答4

【IE/火狐/Chrome操作display:none对象所遇问题解答】相关文章:

如何使CSS渲染更高效

CSS基础教程:CSS的应用

彻底清除浏览器js和css缓存的方法

烧饼修改器加速器版如何刷天天爱消除高分详细教程

CSS中display:inline-block属性妙用

关于DIVCSS浮动float的兼容

火狐下easyui1.3.*弹出window框无法定位到中间问题解决

ie8下不解析background属性与书写格式有关

如何解决IE6/IE7不识别display:inline-block属性

chrome表单自动填充导致input文本框背景变成偏黄色问题解决

精品推荐
分类导航