<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <style>
    .button {
    height: 2em;
    line-height:24px;
    //border: 0;
    //border-radius: .2em;
    background-color: #34538b;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    }
    </style>
 </head>

<body>
      <input type="button" id="button" class="button" value="点击我,显示高度" />
    <script>
        document.getElementById("button").onclick = function() {
            //var oStyle = this.currentStyle? this.currentStyle : window.getComputedStyle(this, null);
            var oStyle = this.currentStyle || window.getComputedStyle(this, null);//IE下获取是2em,Firefox下获取的是24px;浏览器默认1em=16px;
            alert(oStyle.height);
    };
</script>
 </body>
</html>

最新文章

  1. struts-spring-mybatis实现最简单的登录验证
  2. position 属性和 z-index 属性对页面节点层级影响的例子
  3. Sharepoint中有关文件夹的操作
  4. HDU 1863 畅通工程(最小生成树,prim)
  5. 10.24 noip模拟试题
  6. Linux下samba的安装与配置
  7. 重新签名apk文件(手工用命令行)
  8. oracle_windows下命令启动oracle监听和服务
  9. hive union all 使用
  10. iOS 调试 之 打印
  11. golang sql database drivers
  12. [Leetcode]643. Maximum Average Subarray I
  13. WinForm客户端限速下载(C#限速下载)
  14. 原生js实现双向数据绑定
  15. 2019.3.22 JMeter基础操作
  16. A* 算法的原理
  17. PCIe 复位:Clod reset、warm reset、Hot reset、Function level reset
  18. python SQLite说一点点, python使用数据库需要注意的几点
  19. Android 编程下 Canvas and Drawables
  20. golang interface的使用和实现(翻译整理)

热门文章

  1. C语言控制台打印3D爱心图案
  2. 【iOS开发-33】学习手动内存管理临时抛弃ARC以及retain/assign知识——iOSproject师面试必考内容
  3. python oop面向对象笔记
  4. html5-表单常见操作
  5. unity, 不要用TextMesh,用图片代替
  6. Sublime Text 编辑器 插件 之 &quot;Sublime Alignment&quot; 详解
  7. redis源码学习_链表
  8. PHP学习笔记(10)mysql常用命令
  9. MapReduce编程实例4
  10. 用C/C++扩展你的PHP 为你的php增加功能