ʹÓÃ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
Ïà¹ØÎĵµ£º
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;" onc ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false&quo ......
/*
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" ²»×¼Õ ......
»ÆÉ«²¿·ÖΪdate.js
<script type="text/javascript" src="/js/date.js"></script>
<input name="date" type="text" id="date" onBlur="checkDay(this)" style="width:160px;" /><INPUT class="button" style="WIDTH: 64px; HEIGHT: 24px" onClick="setday(this,date)"type="button" value="Ñ¡ÔñÈÕÆÚ ......