selectÔªËØjavascript³£ÓòÙ×÷
*˵Ã÷£ºselectÔªËØjavascript³£ÓòÙ×÷
* 1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem
* 2.¼ÓÈëÒ»¸öItem
* 3.ɾ³ýֵΪvalueµÄËùÓÐItem
* 4.ɾ³ýijһ¸öindexµÄÑ¡Ïî
* 5.¸üеÚindexÏîµÄvalueºÍtext
* 6.ÉèÖÃselectÖÐÖ¸¶¨textµÄµÚÒ»¸öItemΪѡÖÐ
* 7.ÉèÖÃselectÖÐÖ¸¶¨valueµÄµÚÒ»¸öItemΪѡÖÐ
* 8.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄvalue
* 9.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄindex
* 10.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄtext
* 11.Çå¿ÕËùÓÐÑ¡Ïî
-------------------------------------------------------*/
//1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem
function ExistValue(obj,value){
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == value){
return true;
}
}
return false;
}
//2.¼ÓÈëÒ»¸öItem
function AddItem(obj,text,value){
var varItem = new Option(text,value);
obj.options.add(varItem);
}
//3.ɾ³ýֵΪvalueµÄËùÓÐItem
function RemoveItems(obj,value){
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == ItemValue){
obj.options.remove(i);
}
}
}
//4.ɾ³ýijһ¸öindexµÄÑ¡Ïî
function RemoveItem(obj,index){
obj.options.remove(index);
}
//5.¸üеÚindexÏîµÄvalueºÍtext
function UpdateItem(obj,index,value,text){
obj.options[index].value = value;
obj.options[index].text = text;
}
//6.ÉèÖÃselectÖÐÖ¸¶¨textµÄµÚÒ»¸öItemΪѡÖÐ
function SelectItemByText(obj,text){
var isExit = false;
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].text == text){
obj.options[i].selected = true;
return true;
}
}
return false;
}
//7.ÉèÖÃselectÖÐÖ¸¶¨valueµÄµÚÒ»¸öItemΪѡÖÐ
function SelectItemByValue(obj,value){
var isExit = false;
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == value){
obj.options[i].selected = true;
return true;
}
}
return false;
}
//8.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄvalue£¬index,text
function GetValue(obj){
return obj.value;
}
//9.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄindex
function GetInd
Ïà¹ØÎĵµ£º
°¦£¬ºÜ¾ÃÒÔǰдµÄ´úÂ룬ɹһɹ£¬¹À¼Æ×Ô¼º¿´¶¼¿´²»¶®ÁË£¬:(
var head="display:''"
img_close=new Image()
img_close.src="/sysManage/images/f.gif"
img_open=new Image()
img_open.src="/sysManage/images/fo.gif"
img3=new Image()
img3.src="/sysManage/images/e.gif" ......
ת»¯ÎªBooleanÀàÐÍ
ËùÓÐJavaScriptÖеÄÖµ¶¼ÄÜÒþʽµÄת»¯ÎªBooleanÀàÐÍ£¬±ÈÈ磺
0 == false; // true
1 == true; // true
'' == false // true
null == false // true
µ«ÊÇÕâЩֵ¶¼²»ÊÇBooleanÀàÐÍ¡£
Òò´Ëµ±ÎÒÃÇʹÓÃÈý¸öµÈ ......
Js´úÂë
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="wmp" >
<param name="URL" value="" /> ......
http://www.cnblogs.com/sanshi/archive/2009/07/08/1519036.html
Ò»¡¢sanshi javascript ¼Ì³ÐϵÁУº
1¡¢ JavaScript¼Ì³ÐÏê½â£¨Ò»£© http://www.cnblogs.com/sanshi/archive/2009/07/08/1519036.html
2¡¢JavaScript¼Ì³ÐÏê½â£¨¶þ£©
3¡¢ JavaScript¼Ì³ÐÏê½â£¨Èý£©
4¡¢JavaScript¼Ì³ÐÏê½â£ ......
Js´úÂë
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="wmp" >
<param name="URL" value="" /> ......