ʹÓÃjavascript»ñÈ¡Îı¾¿ò,ÏÂÀ¿ò,µ¥Ñ¡¿òµÄÖµ²¢ÇÒ¸³Öµ
1.Îı¾¿ò
1.1 <input type="text" name="test" id="test">
ͨ¹ývar t=document.getElementById("test").value°ÑÖµ¸³¸ø±äÁ¿t,
1.2 µ±È»Ò²¿ÉÒÔ·´¹ýÀ´°ÑÒÑÖªµÄ±äÁ¿Öµ¸³¸øÎı¾¿ò£¬ÀýÈ磺
var m = "5";
document.getElementById("test").value= m;
2.ÏÂÀÁбí¿ò
2.1 <select name="sel" id="sel" onchange="look();">
<option value="1" >11</option>
<option value="2" selected>22</option>
<option value="3">33</option>
</select>
ͨ¹ývar s=document.getElementById("sel").value»ñÈ¡<select>¿òÖÐÑ¡ÖеÄÖµ£¬´Ë´¦Ä¬ÈÏÑ¡ÖÐvalue="2"µÄÑ¡ÏËùÒÔ¸³¸ø±äÁ¿s µÄÖµÊÇ"2",¶ø²»ÊÇ"22",
¼ÙÈçÒª°Ñ<select>ÖÐÑ¡ÔñµÄ"Öµ"Èç"3"¶ÔÓ¦µÄ"Îı¾Öµ"("33")¸³¸øtestÎı¾¿ò£¬¿ÉÒÔͨ¹ýÈçÏ·½·¨£¬
<script language="javascript">
function look(){
var se =document.getElementById("sel");
var option=se.getElementsByTagName("option");
var str = "" ;
for(var i=0;i<option.length;++i)
{
if(option[i].selected)
{
document.getElementById("test").value = option[i].text;
}
&nb
Ïà¹ØÎĵµ£º
ÏÖ½«´úÂëÌù³ö£¬¹²Ã㣡
HTML²¿·Ö£º=====================================================
<html>
<head>
<script language="VBscript">
<!--
function M_b()
set M_e=Scene.Engine
M_e.Nodes("MyScript").Fields("nodestring")="Shape {geometry Box{}}"
M_e.Nodes ......
/*
JavaScript½Å±¾£¬ÑéÖ¤±íµ¥ÖеÄÊý¾ÝÏî begin
-------------------------------------------------------------------------------
*/
function checkForm(objFrm){
var len = 0;
len = objFrm.elements.length;
var i = 0;
var objCheck;
//Îı¾¿ò
for(i = 0; i < len; i ++){
objCheck = objF ......
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 ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ ......
javascriptÊDz»ÄÜÖ±½Ó±È½ÏÁ½¸öÊý×éÊÇ·ñÏàµÈµÄ¡£ÀýÈ磺
var a = [1,2,3];
var b = [1,2,3];
alert(a == b); // false
½á¹ûÊÇ false. Ö¤Ã÷Á½¸öÊý×é²»ÄÜÖ±½Ó±È½ÏÏàµÈ¡£
½â¾ö·½·¨Ò»£º
ÏÈÅÅÐò£¬ÔÙÀûÓÃtoString·½·¨£¬±È½Ï¡£ÀýÈ磺
var a = [1,2,3];
var b = [1,2,3];
alert(a.sort().toString() ......