易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript仿Excel表格演示

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE>JavaScript仿Excel表格演示- /</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<SCRIPT type=text/JavaScript>
var toBeColor = "#F8F9FC";
var backColor = "#FFFFFF";
var tableId = "tbData";
var table;
var tbody;
var divShowInput;
window.onload=function(){
beginListen();
table = document.getElementById(tableId);
tbody = table.getElementsByTagName("tbody")[0];
actionFill ();
otherFill();
creatDiv();
divShowInput = document.getElementById("divShowInput");
}
function creatDiv(){
var filldiv = document.createElement("div");
filldiv.setAttribute("id","divShowInput");
var barp = document.createElement("p");
barp.setAttribute("id","barTitle");
barp.onclick=hideDiv;
var defComP = document.createElement("p");
defComP.setAttribute("id","defComP");
defComP.onclick=hideDiv;
var cleara = document.createElement("a");
/* / */
cleara.setAttribute("href","javascript:void 0");
cleara.onclick=clearInput;
var clearatext = document.createTextNode("清空");
cleara.appendChild(clearatext);
defComP.appendChild(cleara);
var autoP = document.createElement("P");
autoP.setAttribute("id","autoFillP");
filldiv.appendChild(barp);
filldiv.appendChild(defComP);
filldiv.appendChild(autoP);
document.body.appendChild(filldiv);
}
function actionFill (){
var dbinputs = tbody.getElementsByTagName("input");
for (var i = 1;i<=dbinputs.length-1;i++){
dbinputs[i].onfocus=stopListen;
dbinputs[i].onblur=beginListen;
dbinputs[i].ondblclick=showDiv;
dbinputs[i].onmouseover=onChangTrColor;
dbinputs[i].onmouseout=outChangTrColor;
dbinputs[i].onclick=readyedit;
dbinputs[i].onkeydown=gonext;
}
}
function otherFill (){
var Bt_selectAll = document.getElementById("Bt_selectAll")


相关文档:

javascript获取select的值全解

获取显示的汉字
document.getElementById("bigclass").options[window.document.getElementById("bigclass").selectedIndex].text
获取数据库中的id
window.document.getElementById("bigclass").value
获取select组分配的索引id
window.document.getElementById("bigclass").selectedIndex
例子:
<select name= ......

↑→40种网页常用小技巧(javascript)←↓

 1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......

javascript 截取字符串

 1.substring 方法
定义和用法
substring 方法用于提取字符串中介于两个指定下标之间的字符。
语法
stringObject.substring(start,stop)
参数 描述
start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。
stop 可选。一个非负的整数,比要提取的子串的最后一个字符 ......

javascript通过css属性的设置来控制展开;收缩菜单

 
<!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>
    <title>Admin ManageMenu</title>
&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号