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

javascript ÏÂÀ­¿ò£¨select)Ñ¡ÔñÓ뱻ѡÔñ

<html>
<head>
<mce:script type = "text/javascript"><!--

function changetext()
{
var x = document.getElementById("list");
for (var i = 0;i < x.length;i++ )
{
if (x.options[i].selected)
{
document.getElementById("text").value = x.options[i].text;
break;
}
}
}
function changelist()
{
var x = document.getElementById("list");
for (var i = 0;i <x.length ;i++)
{
if (document.getElementById("text").value == x.options[i].text)
{
x.options[i].selected =true;
}
}
}

// --></mce:script>
</head>
<body>
<input type = "text" id = "text" >
<input type = "button" value = "changelist" onclick = "changelist();">
<select id = "list" onchange= changetext();>
<option >1</option>
<option >2</option>
<option >3</option>
<option >4</option>
<option >5</option>
<option >6</option>
<option >7</option>
<option >8</option>
<option >9</option>
<option >10</option>
</select>
</body>
</html>


Ïà¹ØÎĵµ£º

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=& ......

ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ£¨×ªÔØ£©

JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý× ......

JavaScript Closure£¨±Õ°ü£© ÄÇЩÊÂ

1 Ò»ÆðÀ§»óʼÓÚ±äÁ¿µÄ×÷ÓÃÓò
ÇëÏÈ¿´ÏÂÃæµÄ´úÂ룺
ʾÀý1£º
     var message = " this is a very simple function ";
     function simpleFunc(){
             alert(message);
     }
±³ºóµÄµÀÀí´ó¼Ò¶¼¶®£¨Èç¹û²»¶®µÄ¿ÉÒÔÏȱðÍù ......

javascript ¾­³£ÓõÄһЩÌØÊâЧ¹û

1. ÈÃÎÄ×Ö²»Í£µÄ¹ö¶¯¡£
     <marouee>¹ö¶¯ÎÄ×Ö</marouee>
2.¼Ç¼²¢ÏÔʾÍøÒ³µÄ×îºóÐÞ¸Äʱ¼ä
     <script language="javascript">
         doucument.write("×îºó¸üÐÂʱ¼ä£º" + document.lastModified + " " ......

ÄÇЩÏà¼ûºÞÍíµÄ JavaScript ¼¼ÇÉ

JavaScript µÄ³É¹¦ÈÃÈ˽ò½òÀÖµÀ£¬Îª Web ÍøÒ³±àд JavaScript ´úÂëÒѾ­ÊÇËùÓÐ Web Éè¼ÆʦµÄ»ù±¾¹¦£¬ÕâÃÅÓÐȤµÄÓïÑÔÔ̲Ø×ÅÐí¶à²»ÎªÈËÊìÖªµÄ¶«Î÷£¬¼´Ê¹¶àÄêµÄ JavaScript ³ÌÐòÔ±£¬Ò²Î´ÄÜÍêÈ«³Ô͸¡£±¾ÎÄ´Ó7¸ö·½Ãæ½²Êö JavaScript ÖÐÄÇЩÄã²»ºÜÊìÖªµ«·Ç³£ÊµÓõļ¼ÇÉ¡£
¼òÂÔÓï¾ä
JavaScript ¿ÉÒÔʹÓüòÂÔÓï¾ä¿ìËÙ´´½¨¶ÔÏóºÍÊý× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ