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

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="bigclass" id="bigclass" onChange="javascript:updatePage2();">
<option value="" selected="selected">ajaxʵÑé</option>
<option value="4">ÎÒÊÊÒËÊйþ</option>
</select>
ʹÓÃ
document.getElementById("bigclass").options[window.document.getElementById("bigclass").selectedIndex].text
µÄ½á¹ûÊÇ£ºÎÒÊÊÒËÊйþ
ʹÓÃ
window.document.getElementById("bigclass").value
µÄ½á¹ûÊÇ£º4
ʹÓÃ
window.document.getElementById("bigclass").selectedIndex
µÄ½á¹ûÊÇ£º1
Ò»¡¢ÐÂÔöÒ»¸öoption
    var sel=document.getElementById("selectµÄid");
    var op=document.createElement("option");
     op.value=Öµ;
     op.text=ÏÔʾÎı¾;
     sel.add(op);
¶þ¡¢É¾³ýÒ»¸öoption
    var sel=document.getElementById("typelist");
if(sel.selectedIndex==-1)
   alert("ÇëÑ¡ÖÐҪɾ³ýµÄÏî!");
for(var i=0;i<sel.options.length;i++){
if(sel.options[i].selected){
sel.options.remove(i);
break;
}
}
Èý¡¢Çå¿ÕselectµÄËùÓÐoption
   var citySel=document.getElementById("selectµÄid");
   citySel.options.length=0;
  
ËÄ¡¢»ñµÃÑ¡ÖÐÏîµÄÖµ
    var citySel=document.getElementById("selectµÄid");
    var selectedValue=citySel.value;
Îå¡¢»ñµÃµ±Ç°Ñ¡ÖÐÏîµÄË÷Òý
    var selectedIndex=document.all.objSelect.selectedIndex;
Áù¡¢ÉèÖÃselectµÄµ±Ç°Ñ¡ÖÐÏî
    ·½·¨1(µ¥¸öselect)£º document.getElementById("products_type_id").selectedIndex=1;
    ·½·¨2(¼¶ÁªselectÈçÊ¡Êм¶Áª)£º
     var province_sel=document.getElementById("province");//


Ïà¹ØÎĵµ£º

javascriptÕýÔò±í´ïʽ

JavaScript--ÕýÔò±í´ïʽ
ÕýÔò±í´ïʽ(regular expression)¶ÔÏó°üº¬Ò»¸öÕýÔò±í´ïʽģʽ(pattern)¡£Ëü¾ßÓÐÓÃÕýÔò±í´ïʽģʽȥƥÅä»ò´úÌæÒ»¸ö´®(string)ÖÐÌØ¶¨×Ö·û(»ò×Ö·û¼¯ºÏ)µÄÊôÐÔ(properties)ºÍ·½·¨(methods)¡£
ÕýÔò±í´ïʽ¹¹Ô캯Êý£º new RegExp("pattern"[,"flags"]);
²ÎÊý˵Ã÷£º
pattern -- Ò»¸öÕýÔò±í´ïʽÎı¾
flag ......

javascriptµÄdelete

¸Õ¸Õ°Ý¶ÁÁË JavascriptµÄ±äÁ¿Óëdelete²Ù×÷·û ºÜÊÜÆô·¢¡£Ô­ÎÄֻ˵Á˽á¹û£¬Ã»¸üÉîÈëÍÆÀí×ܽáÒ»ÏÂΪʲô£¬ÒÔ¼°ÔõôÀí½âºÃÒ»µã£¬ÎÒÕâÀï²¹³ä×ܽáһϡ£
 /// <reference path="http://tech.idv2.com/2008/01/09/javascript-variables-and-delete-operator/" />
/*
Óëc++²»Í¬£¬javascriptµÄdelete²»»áɾ³ ......

JavaScriptÖеĹ«ÓгÉÔ±£¬Ë½ÓгÉÔ±ºÍ¾²Ì¬³ÉÔ±

˽ÓгÉÔ±¾ÍÊÇÔÚÀàµÄÄÚ²¿ÊµÏÖÖпÉÒÔ¹²ÏíµÄ³ÉÔ±¡£µ«ÊDz¢²»¶ÔÍ⹫¿ª£¬JavaScriptÖв¢Ã»ÓÐÌØÊâµÄ»úÖÆÀ´¶¨Òå˽ÓгÉÔ±£¬µ«ÊÇ¿ÉÒÔÓÃһЩ¼¼ÇÉÀ´ÊµÏÖÕâ¸ö¹¦ÄÜ¡£Ö÷ÒªÊÇͨ¹ý±äÁ¿µÄ×÷ÓÃÓòÐÔÖÊÀ´ÊµÏֵģ¬ÔÚÒ»¸öº¯ÊýÄÚ²¿¶¨ÒåµÄ±äÁ¿³ÆÎª¾Ö²¿±äÁ¿£¬¸Ã±äÁ¿²»Äܱ»º¯ÊýÍâµÄ³ÌÐòËù·ÃÎÊ£¬¿ÉÒÔ±»º¯ÊýÄÚ²¿¶¨ÒåµÄǶÌ׺¯ÊýËù·ÃÎÊ¡£
ÔÚÀàµÄ¹¹Ô캯ÊýÖÐ ......

JavaScriptʵÏÖÀàµÄ¼Ì³Ð

ÔÚJavaScriptÖÐûÓÐרÃŵĻúÖÆÀ´ÊµÏÖÀàµÄ¼Ì³Ð£¬µ«ÊÇ¿ÉÒÔͨ¹ý¿½±´Ò»¸öÀàµÄprototypeµ½ÁíÍâÒ»¸öÀàÀ´ÊµÏּ̳У¬Ò»ÖÖ¼òµ¥µÄʵÏÖÈçÏ£º
function class1(){
}
function class2(){
}
class2.prototype=class1.prototype;
class2.prototype.moreProperty="xxx";
class2.prototype.moreMethod1=function(){
}
var obj = ne ......

javascriptѧϰ¼ÌÐø

 Ñ§Ï°Á˽âÁËjavascriptµÄÒ»Ð©ÔªËØ¶ÔÏóµÄ´´½¨£¬»ñÈ¡µÈ¡£ÏÖÔÚµÄѧϰÖ÷ÒªÊÇÉæ¼°ÔÚ±àдjavascriptµ±ÖÐÓ¦¸Ã×¢ÒâµÄһЩϸ½Ú£º
1 ×¢Òâ±äÁ¿µÄ±àдÕýÈ·
2 ²ÎÊý´«µÝ³öÏÖÎÊÌâ »òÕß²»´æÔÚÒ²»áµ¼Ö³ö´í
3 js´íÎóµÄ¿ØÖƺ¯Êý window.onerror£ºÆä½«»á´øÈý¸ö²ÎÊýÐÅÏ¢ ¿Éͨ¹ý²ÎÊýÊý×é arguments »ñÈ¡ÐÅÏ¢ ´íÎóÐÅÏ¢£¬´íÎóÒ³ÃæµÄurlºÍ´í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ