zoukankan      html  css  js  c++  java
  • tabIndex 主要是美化tab键切换的体现

    原帖:http://www.cnblogs.com/rubylouvre/archive/2009/12/07/1618182.html

    跟随司徒正美兄的一个实践。

    window.onload = function(){
                
    var inputs = document.getElementsByTagName('input');
                
    for(var i=0, n=inputs.length; i<n; i++){
                    inputs[i].style.cssText 
    = 'background:#eee; border:1px solid #ccc;';
                    inputs[i].onfocus 
    = function(){
                        
    this.style.cssText = 'background:#7ecef4; border:1px solid #00a0e9;';
                    }
                    inputs[i].onblur 
    = function(){
                        
    this.style.cssText = 'background:#eee; border:1px solid #ccc;';
                    }
                }
            }

    HTML结构:

    <form name="myForm">
                
    <input tabindex="1" value="第一个">第一个<br />
                
    <input tabindex="3" value="第三个">第三个<br />
                
    <input tabindex="2" value="第二个">第二个<br />
                
    <input tabindex="5" value="第五个">第五个<br />
                
    <input tabindex="4" value="第四个">第四个<br />
                
    <input tabindex="6" value="第六个">第六个<br />
            
    </form>
  • 相关阅读:
    从马琳决赛被翻盘想到的
    C语言中的位运算
    瑞星杀毒软件所有监控已禁用!
    回来了,重新开始
    使用 javascript 标记高亮关键词
    我的webgis客户端引擎AIMap
    RPM 命令大全
    终结IE6下背景图片闪烁问题
    linux下挂载硬盘光驱和U盘
    在JavaScript中实现命名空间
  • 原文地址:https://www.cnblogs.com/jikey/p/1619157.html
Copyright © 2011-2022 走看看