Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScriptÖÐDOMÊ÷µÄNode½Ó¿ÚµÄһЩ¼òµ¥Ó¦ÓÃ

1. ÓÃÀàÃû²éÕÒÔªËØ
<!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>Untitled Page</title>
<script type="text/javascript
">
//±¾Ò³·½·¨:ÓÃÀàÃûÑ¡ÔñÔªËØ
function
getElements(cla) {
var
elements = document
.getElementsByTagName("*
");
var
elems = [];
for
(var
i = 0; i < elements.length
; i++) {
if
(elements[i].className && has(elements[i].className,cla)) {
elems.push(elements[i]);
}
}
return
elems;
}
function
has(ele, name
) {
var
clla = [];
if
(ele) clla = ele.split(' ');
for
(var
i = 0; i < clla.length
; i++)
if
(clla[i] == name
) {return
true
};
return
false
;
}
</script>
<style type="text/css
">
.h
{background-color:Aqua;
}
</style>
</head>
<body>
<i id="iiii
" class
="h
">Just test.</i><br />
<span id="ssss
" class
="h
">hehe</span>
<script type="text/javascript
">
var
e = getElements("h
");
var
nn = ""
for
(var
i = 0; i < e.length
; i++) {
nn +="id:
" + e[i].id + "\n
";
nn += "------line------\n
";
}
alert
(nn);
</script>
</body>
</html>
<
script
>
// This function takes a Node n, replaces it in the tree with an Element node
// that represents an HTML <
b
>
tag, and then makes the original node the
// child of the new <
b
>


Ïà¹ØÎĵµ£º

JavaScript ´´½¨Àà/¶ÔÏóµÄ¼¸ÖÖ·½Ê½

ÔÚJSÖУ¬´´½¨¶ÔÏó£¨Create Object£©²¢²»ÍêÈ«ÊÇÎÒÃÇʱ³£ËµµÄ´´½¨Àà¶ÔÏó£¬JSÖеĶÔÏóÇ¿µ÷µÄÊÇÒ»ÖÖ¸´ºÏÀàÐÍ£¬JSÖд´½¨¶ÔÏó¼°¶Ô¶ÔÏóµÄ·ÃÎÊÊǼ«ÆäÁé»îµÄ¡£
JS¶ÔÏóÊÇÒ»ÖÖ¸´ºÏÀàÐÍ£¬ËüÔÊÐíÄãͨ¹ý±äÁ¿Ãû´æ´¢ºÍ·ÃÎÊ£¬»»Ò»ÖÖ˼·£¬¶ÔÏóÊÇÒ»¸öÎÞÐòµÄÊôÐÔ¼¯ºÏ£¬¼¯ºÏÖеÄÿһÏÓÉÃû³ÆºÍÖµ×é³É£¨ÌýÆðÀ´ÊDz»ÊǺÜÏñÎÒÃdz£Ìý˵µÄHASH±í¡¢× ......

Javascriptµ¼³öExcel

<!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; ......

ÔÚJavaÖÐʹÓÃjavascriptº¯Êý

JDK6ÒѾ­·¢²¼ºÜ¾ÃÁË£¬ºÜÔç¾ÍÌý¹ýËûÒѾ­Ö§³Ö½Å±¾ÓïÑÔÁË£¬²»¹ýһֱûÓÐʱ¼ä³¢ÊÔ£¬½ñÌì͵ÏÐÊÔÁËһϣ¬¸Ð¾õ²»´í¡£
¡¡¡¡javax.script°üËüÊÇJavaÐÂÔöµÄ²Ù×÷½Å±¾µÄ¹¤¾ß°ü£¬
¡¡¡¡ÀûÓÃËüÎÒÃÇ¿ÉÒԶԽű¾ÓïÑÔ½øÐвÙ×÷£¨±¾Àý½öÊÇÕë¶Ôjavascript
£©
¡¡¡¡1.ÓÃÒýÇæÖ±½Ó½âÎö½Å±¾¹«Ê½
¡¡¡¡Java´úÂë
¡¡¡¡//´´½¨½Å±¾ÒýÇæ¹ÜÀíÆ÷
¡¡¡¡Scri ......

javascript¿ØÖÆtextbox×ÖÊýµÄ½Å±¾ ·Ç³£ºÃÓÃ

ÒÔÇ°×öÏîĿʱºò¾­³£Óõ½¶àÐÐÊäÈë¿ò×ÖÊýµÄ¿ØÖÆÒÔ¼°Í³¼ÆÏÔʾµÄÇé¿ö£¬×ÛºÏÁ˼¸ÖÖÇé¿öºóÏÖÔڹ̶¨ÓÃÁËÕâ¸ö½Å±¾¡£
ÀýÈç ÒªÊäÈëÃèÊötextbox
<div>
<h3>
ÃèÊö£º</h3>
<asp:TextBox runat="server" ID="tbdesciption" Height="200px" TextMode="MultiLine" onkey ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ