javascript對select標(biāo)簽的控制(option選項(xiàng)/select)
更新時間:2013年01月31日 14:30:26 作者:
html中的select標(biāo)簽,也是asp.net中的asp:DropDownList控件,接下來介紹javascript對select標(biāo)簽的控制,感興趣的朋友可以了解下,或許本文對你有所幫助
html中的select標(biāo)簽,也是asp.net中的asp:DropDownList控件。
javascript對它們的操作
一、基礎(chǔ)理解
var e = document.getElementById("selectId");
e. options= new Option("文本","值") ;
//創(chuàng)建一個option對象,即在<select>標(biāo)簽中創(chuàng)建一個或多個<option value="值">文本</option>
//options是個數(shù)組,里面可以存放多個<option value="值">文本</option>這樣的標(biāo)簽
1:options[ ]數(shù)組的屬性:
length屬性---------長度屬性
selectedIndex屬性--------當(dāng)前被選中的框中的文本的索引值,此索引值是內(nèi)存自動分配的(0,1,2,3.....)對應(yīng)(第一個文本值,第二個文本值,第三個文本值,第四個文本值..........)
2:單個option的屬性(---obj.options[obj.selecedIndex]是指定的某個<option>標(biāo)簽,是一個---)
text屬性---------返回/指定 文本
value屬性------返回/指定 值,與<options value="...">一致。
index屬性-------返回下標(biāo),
selected 屬性-------返回/指定該對象是否被選中.通過指定 true 或者 false,可以動態(tài)的改變選中項(xiàng)
defaultSelected 屬性-----返回該對象默認(rèn)是否被選中。true / false。
3:option的方法
增加一個<option>標(biāo)簽-----obj.options.add(new("文本","值"));<增>
刪除一個<option>標(biāo)簽-----obj.options.remove(obj.selectedIndex)<刪>
獲得一個<option>標(biāo)簽的文本-----obj.options[obj.selectedIndex].text<查>
修改一個<option>標(biāo)簽的值-----obj.options[obj.selectedIndex]=new Option("新文本","新值")<改>
刪除所有<option>標(biāo)簽-----obj.options.length = 0
獲得一個<option>標(biāo)簽的值-----obj.options[obj.selectedIndex].value
注意:
a:上面的寫的是如這樣類型的方法obj.options.function()而不寫obj.funciton,是因?yàn)闉榱丝紤]在IE和FF 下的兼容,如obj.add()只能在IE中有效.
b:obj.option中的option不需要大寫,new Option中的Option需要大寫
二 、應(yīng)用
<html>
<head>
<script language="javascript">
function number(){
var obj = document.getElementById("mySelect");
//obj.options[obj.selectedIndex] = new Option("我的吃吃","4");//在當(dāng)前選中的那個的值中改變
//obj.options.add(new Option("我的吃吃","4"));再添加一個option
//alert(obj.selectedIndex);//顯示序號,option自己設(shè)置的
//obj.options[obj.selectedIndex].text = "我的吃吃";更改值
//obj.remove(obj.selectedIndex);刪除功能
}
</script>
</head>
<body>
<select id="mySelect">
<option>我的包包</option>
<option>我的本本</option>
<option>我的油油</option>
<option>我的擔(dān)子</option>
</select>
<input type="button" name="button" value="查看結(jié)果" onclick="number();">
</body>
</html>
1.動態(tài)創(chuàng)建select
function createSelect(){
var mySelect = document.createElement("select");
mySelect.id = "mySelect";
document.body.appendChild(mySelect);
}
2.添加選項(xiàng)option
function addOption(){
//根據(jù)id查找對象,
var obj=document.getElementById('mySelect');
//添加一個選項(xiàng)
obj.add(new Option("文本","值")); //這個只能在IE中有效
obj.options.add(new Option("text","value")); //這個兼容IE與firefox
}
3.刪除所有選項(xiàng)option
function removeAll(){
var obj=document.getElementById('mySelect');
obj.options.length=0;
}
4.刪除一個選項(xiàng)option
function removeOne(){
var obj=document.getElementById('mySelect');
//index,要刪除選項(xiàng)的序號,這里取當(dāng)前選中選項(xiàng)的序號
var index=obj.selectedIndex;
obj.options.remove(index);
}
5.獲得選項(xiàng)option的值
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index].value;
6.獲得選項(xiàng)option的文本
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index].text;
7.修改選項(xiàng)option
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index]=new Option("新文本","新值");
8.刪除select
function removeSelect(){
var mySelect = document.getElementById("mySelect");
mySelect.parentNode.removeChild(mySelect);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<head>
<script language=JavaScript>
function $(id)
{
return document.getElementById(id)
}
function show()
{
var selectObj=$("area")
var myOption=document.createElement("option")
myOption.setAttribute("value","10")
myOption.appendChild(document.createTextNode("上海"))
var myOption1=document.createElement("option")
myOption1.setAttribute("value","100")
myOption1.appendChild(document.createTextNode("南京"))
selectObj.appendChild(myOption)
selectObj.appendChild(myOption1)
}
function choice()
{
var index=$("area").selectedIndex;
var val=$("area").options[index].getAttribute("value")
if(val==10)
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
var sh=document.createElement("select")
sh.add(new Option("浦東新區(qū)","101"))
sh.add(new Option("黃浦區(qū)","102"))
sh.add(new Option("徐匯區(qū)","103"))
sh.add(new Option("普陀區(qū)","104"))
$("context").appendChild(sh)
}
if(val==100)
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
var nj=document.createElement("select")
nj.add(new Option("玄武區(qū)","201"))
nj.add(new Option("白下區(qū)","202"))
nj.add(new Option("下關(guān)區(qū)","203"))
nj.add(new Option("棲霞區(qū)","204"))
$("context").appendChild(nj)
}
}
function calc()
{
var x=$("context").childNodes.length-1;
alert(x)
}
function remove()
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
}
</script>
<body><div id="context">
<select id="area" on
change="choice()">
</select>
</div>
<input type=button value="顯示" onclick="show()">
<input type=button value="計(jì)算結(jié)點(diǎn)" onclick="calc()">
<input type=button value="刪除" onclick="remove()">
</body>
</html>
根據(jù)這些東西,自己用JQEURY AJAX+JSON實(shí)現(xiàn)了一個小功能如下:
JS代碼:(只取了于SELECT相關(guān)的代碼)
/**
* @description 構(gòu)件聯(lián)動下拉列表 (用JQUERY 的AJAX配合JSON實(shí)現(xiàn))
* @prarm selectId 下拉列表的ID
* @prarm method 要調(diào)用的方法名稱
* @prarm temp 此處存放軟件ID
* @prarm url 要跳轉(zhuǎn)的地址
*/
function linkAgeJson(selectId,method,temp,url){
$j.ajax({
type: "get",//使用get方法訪問后臺
dataType: "json",//返回json格式的數(shù)據(jù)
url: url,//要訪問的后臺地址
data: "method=" + method+"&temp="+temp,//要發(fā)送的數(shù)據(jù)
success: function(msg){//msg為返回的數(shù)據(jù),在這里做數(shù)據(jù)綁定
var data = msg.lists;
coverJsonToHtml(selectId,data);
}
});
}
/**
* @description 將JSON數(shù)據(jù)轉(zhuǎn)換成HTML數(shù)據(jù)格式
* @prarm selectId 下拉列表的ID
* @prarm nodeArray 返回的JSON數(shù)組
*
*/
function coverJsonToHtml(selectId,nodeArray){
//get select
var tempSelect=$j("#"+selectId);
//clear select value
isClearSelect(selectId,'0');
var tempOption=null;
for(var i=0;i<nodeArray.length;i++){
//create select Option
tempOption= $j('<option value="'+nodeArray[i].dm+'">'+nodeArray[i].mc+'</option> ');
//put Option to select
tempSelect.append(tempOption);
}
// 獲取退化構(gòu)件列表
getCpgjThgl(selectId,'thgjDm');
}
/**
* @description 清空下拉列表的值
* @prarm selectId 下拉列表的ID
* @prarm index 開始清空的下標(biāo)位置
*/
function isClearSelect(selectId,index){
var length=document.getElementById(selectId).options.length;
while(length!=index){
//長度是在變化的,因?yàn)楸仨氈匦芦@取
length=document.getElementById(selectId).options.length;
for(var i=index;i<length;i++)
document.getElementById(selectId).options.remove(i);
length=length/2;
}
}
/**
* @description 獲取退化構(gòu)件列表
* @prarm selectId1 引用軟件下拉列表的ID
* @prarm selectId2 退化構(gòu)件下拉列表的ID
*/
function getCpgjThgl(selectId1,selectId2){
var obj1=document.getElementById(selectId1);//引用軟件下拉列表
var obj2=document.getElementById(selectId2);//退化構(gòu)件下拉列表
var len=obj1.options.length;
//當(dāng)引用軟件列表長度等于1時返回,不做操作
if(len==1){
return false;
}
//清空下拉列表的值,兩種方式都可以
// isClearSelect(selectId2,'1');
document.getElementById(selectId2).length=1;
for(var i=0;i<len; i++){
var option= obj1.options[i];
//引用軟件被選中項(xiàng)不加入
if(i!=obj1.selectedIndex){
//克隆OPTION并添加到SELECT中
obj2.appendChild(option.cloneNode(true));
}
}
}
HTML代碼:
<TABLE width="100%" border=0 align="left" cellPadding=0 cellSpacing=1>
<tr>
<td class="Search_item_18"> <span class="Edit_mustinput">*</span>引用軟件:</td>
<td class="Search_content_82">
<input name="yyrjMc" id="yyrjMc" type="text" class="Search_input" tabindex="3" size="30" >
<input name="yyrjDm" id="yyrjDm" type="hidden" >
<input type="button" class="Search_button_select"
onClick="linkAgeTree('linkage','yyrjtree','yyrjMc','yyrjDm','linkageTree','1');" value="選擇...">
</td>
</tr>
<tr>
<td class="Search_item"> <span class="Edit_mustinput">*</span>引用分版:</td>
<td class="Search_content" id="yyfb">
<select name="yyfbDm" style="width:160" id="yyfbDm" onChange="getCpgjThgl('yyfbDm','thgjDm')">
</select>
</td>
</tr>
<tr>
<td class="Search_item">退化構(gòu)件:</td>
<td class="Search_content" id="thgj">
<select name="thgjDm" style="width:160" id="thgjDm">
<option value="-1" selected>無</option>
</select>
</td>
</tr>
</TABLE>
javascript對它們的操作
一、基礎(chǔ)理解
復(fù)制代碼 代碼如下:
var e = document.getElementById("selectId");
e. options= new Option("文本","值") ;
//創(chuàng)建一個option對象,即在<select>標(biāo)簽中創(chuàng)建一個或多個<option value="值">文本</option>
//options是個數(shù)組,里面可以存放多個<option value="值">文本</option>這樣的標(biāo)簽
1:options[ ]數(shù)組的屬性:
length屬性---------長度屬性
selectedIndex屬性--------當(dāng)前被選中的框中的文本的索引值,此索引值是內(nèi)存自動分配的(0,1,2,3.....)對應(yīng)(第一個文本值,第二個文本值,第三個文本值,第四個文本值..........)
2:單個option的屬性(---obj.options[obj.selecedIndex]是指定的某個<option>標(biāo)簽,是一個---)
text屬性---------返回/指定 文本
value屬性------返回/指定 值,與<options value="...">一致。
index屬性-------返回下標(biāo),
selected 屬性-------返回/指定該對象是否被選中.通過指定 true 或者 false,可以動態(tài)的改變選中項(xiàng)
defaultSelected 屬性-----返回該對象默認(rèn)是否被選中。true / false。
3:option的方法
增加一個<option>標(biāo)簽-----obj.options.add(new("文本","值"));<增>
刪除一個<option>標(biāo)簽-----obj.options.remove(obj.selectedIndex)<刪>
獲得一個<option>標(biāo)簽的文本-----obj.options[obj.selectedIndex].text<查>
修改一個<option>標(biāo)簽的值-----obj.options[obj.selectedIndex]=new Option("新文本","新值")<改>
刪除所有<option>標(biāo)簽-----obj.options.length = 0
獲得一個<option>標(biāo)簽的值-----obj.options[obj.selectedIndex].value
注意:
a:上面的寫的是如這樣類型的方法obj.options.function()而不寫obj.funciton,是因?yàn)闉榱丝紤]在IE和FF 下的兼容,如obj.add()只能在IE中有效.
b:obj.option中的option不需要大寫,new Option中的Option需要大寫
二 、應(yīng)用
復(fù)制代碼 代碼如下:
<html>
<head>
<script language="javascript">
function number(){
var obj = document.getElementById("mySelect");
//obj.options[obj.selectedIndex] = new Option("我的吃吃","4");//在當(dāng)前選中的那個的值中改變
//obj.options.add(new Option("我的吃吃","4"));再添加一個option
//alert(obj.selectedIndex);//顯示序號,option自己設(shè)置的
//obj.options[obj.selectedIndex].text = "我的吃吃";更改值
//obj.remove(obj.selectedIndex);刪除功能
}
</script>
</head>
<body>
<select id="mySelect">
<option>我的包包</option>
<option>我的本本</option>
<option>我的油油</option>
<option>我的擔(dān)子</option>
</select>
<input type="button" name="button" value="查看結(jié)果" onclick="number();">
</body>
</html>
1.動態(tài)創(chuàng)建select
復(fù)制代碼 代碼如下:
function createSelect(){
var mySelect = document.createElement("select");
mySelect.id = "mySelect";
document.body.appendChild(mySelect);
}
2.添加選項(xiàng)option
復(fù)制代碼 代碼如下:
function addOption(){
//根據(jù)id查找對象,
var obj=document.getElementById('mySelect');
//添加一個選項(xiàng)
obj.add(new Option("文本","值")); //這個只能在IE中有效
obj.options.add(new Option("text","value")); //這個兼容IE與firefox
}
3.刪除所有選項(xiàng)option
復(fù)制代碼 代碼如下:
function removeAll(){
var obj=document.getElementById('mySelect');
obj.options.length=0;
}
4.刪除一個選項(xiàng)option
復(fù)制代碼 代碼如下:
function removeOne(){
var obj=document.getElementById('mySelect');
//index,要刪除選項(xiàng)的序號,這里取當(dāng)前選中選項(xiàng)的序號
var index=obj.selectedIndex;
obj.options.remove(index);
}
5.獲得選項(xiàng)option的值
復(fù)制代碼 代碼如下:
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index].value;
6.獲得選項(xiàng)option的文本
復(fù)制代碼 代碼如下:
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index].text;
7.修改選項(xiàng)option
復(fù)制代碼 代碼如下:
var obj=document.getElementById('mySelect');
var index=obj.selectedIndex; //序號,取當(dāng)前選中選項(xiàng)的序號
var val = obj.options[index]=new Option("新文本","新值");
8.刪除select
復(fù)制代碼 代碼如下:
function removeSelect(){
var mySelect = document.getElementById("mySelect");
mySelect.parentNode.removeChild(mySelect);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//ZH-CN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<head>
<script language=JavaScript>
function $(id)
{
return document.getElementById(id)
}
function show()
{
var selectObj=$("area")
var myOption=document.createElement("option")
myOption.setAttribute("value","10")
myOption.appendChild(document.createTextNode("上海"))
var myOption1=document.createElement("option")
myOption1.setAttribute("value","100")
myOption1.appendChild(document.createTextNode("南京"))
selectObj.appendChild(myOption)
selectObj.appendChild(myOption1)
}
function choice()
{
var index=$("area").selectedIndex;
var val=$("area").options[index].getAttribute("value")
if(val==10)
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
var sh=document.createElement("select")
sh.add(new Option("浦東新區(qū)","101"))
sh.add(new Option("黃浦區(qū)","102"))
sh.add(new Option("徐匯區(qū)","103"))
sh.add(new Option("普陀區(qū)","104"))
$("context").appendChild(sh)
}
if(val==100)
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
var nj=document.createElement("select")
nj.add(new Option("玄武區(qū)","201"))
nj.add(new Option("白下區(qū)","202"))
nj.add(new Option("下關(guān)區(qū)","203"))
nj.add(new Option("棲霞區(qū)","204"))
$("context").appendChild(nj)
}
}
function calc()
{
var x=$("context").childNodes.length-1;
alert(x)
}
function remove()
{
var i=$("context").childNodes.length-1;
var remobj=$("context").childNodes[i];
remobj.removeNode(true)
}
</script>
<body><div id="context">
<select id="area" on
change="choice()">
</select>
</div>
<input type=button value="顯示" onclick="show()">
<input type=button value="計(jì)算結(jié)點(diǎn)" onclick="calc()">
<input type=button value="刪除" onclick="remove()">
</body>
</html>
根據(jù)這些東西,自己用JQEURY AJAX+JSON實(shí)現(xiàn)了一個小功能如下:
JS代碼:(只取了于SELECT相關(guān)的代碼)
復(fù)制代碼 代碼如下:
/**
* @description 構(gòu)件聯(lián)動下拉列表 (用JQUERY 的AJAX配合JSON實(shí)現(xiàn))
* @prarm selectId 下拉列表的ID
* @prarm method 要調(diào)用的方法名稱
* @prarm temp 此處存放軟件ID
* @prarm url 要跳轉(zhuǎn)的地址
*/
function linkAgeJson(selectId,method,temp,url){
$j.ajax({
type: "get",//使用get方法訪問后臺
dataType: "json",//返回json格式的數(shù)據(jù)
url: url,//要訪問的后臺地址
data: "method=" + method+"&temp="+temp,//要發(fā)送的數(shù)據(jù)
success: function(msg){//msg為返回的數(shù)據(jù),在這里做數(shù)據(jù)綁定
var data = msg.lists;
coverJsonToHtml(selectId,data);
}
});
}
/**
* @description 將JSON數(shù)據(jù)轉(zhuǎn)換成HTML數(shù)據(jù)格式
* @prarm selectId 下拉列表的ID
* @prarm nodeArray 返回的JSON數(shù)組
*
*/
function coverJsonToHtml(selectId,nodeArray){
//get select
var tempSelect=$j("#"+selectId);
//clear select value
isClearSelect(selectId,'0');
var tempOption=null;
for(var i=0;i<nodeArray.length;i++){
//create select Option
tempOption= $j('<option value="'+nodeArray[i].dm+'">'+nodeArray[i].mc+'</option> ');
//put Option to select
tempSelect.append(tempOption);
}
// 獲取退化構(gòu)件列表
getCpgjThgl(selectId,'thgjDm');
}
/**
* @description 清空下拉列表的值
* @prarm selectId 下拉列表的ID
* @prarm index 開始清空的下標(biāo)位置
*/
function isClearSelect(selectId,index){
var length=document.getElementById(selectId).options.length;
while(length!=index){
//長度是在變化的,因?yàn)楸仨氈匦芦@取
length=document.getElementById(selectId).options.length;
for(var i=index;i<length;i++)
document.getElementById(selectId).options.remove(i);
length=length/2;
}
}
/**
* @description 獲取退化構(gòu)件列表
* @prarm selectId1 引用軟件下拉列表的ID
* @prarm selectId2 退化構(gòu)件下拉列表的ID
*/
function getCpgjThgl(selectId1,selectId2){
var obj1=document.getElementById(selectId1);//引用軟件下拉列表
var obj2=document.getElementById(selectId2);//退化構(gòu)件下拉列表
var len=obj1.options.length;
//當(dāng)引用軟件列表長度等于1時返回,不做操作
if(len==1){
return false;
}
//清空下拉列表的值,兩種方式都可以
// isClearSelect(selectId2,'1');
document.getElementById(selectId2).length=1;
for(var i=0;i<len; i++){
var option= obj1.options[i];
//引用軟件被選中項(xiàng)不加入
if(i!=obj1.selectedIndex){
//克隆OPTION并添加到SELECT中
obj2.appendChild(option.cloneNode(true));
}
}
}
HTML代碼:
復(fù)制代碼 代碼如下:
<TABLE width="100%" border=0 align="left" cellPadding=0 cellSpacing=1>
<tr>
<td class="Search_item_18"> <span class="Edit_mustinput">*</span>引用軟件:</td>
<td class="Search_content_82">
<input name="yyrjMc" id="yyrjMc" type="text" class="Search_input" tabindex="3" size="30" >
<input name="yyrjDm" id="yyrjDm" type="hidden" >
<input type="button" class="Search_button_select"
onClick="linkAgeTree('linkage','yyrjtree','yyrjMc','yyrjDm','linkageTree','1');" value="選擇...">
</td>
</tr>
<tr>
<td class="Search_item"> <span class="Edit_mustinput">*</span>引用分版:</td>
<td class="Search_content" id="yyfb">
<select name="yyfbDm" style="width:160" id="yyfbDm" onChange="getCpgjThgl('yyfbDm','thgjDm')">
</select>
</td>
</tr>
<tr>
<td class="Search_item">退化構(gòu)件:</td>
<td class="Search_content" id="thgj">
<select name="thgjDm" style="width:160" id="thgjDm">
<option value="-1" selected>無</option>
</select>
</td>
</tr>
</TABLE>
您可能感興趣的文章:
- javascript Select標(biāo)記中options操作方法集合
- js 操作select和option常用代碼整理
- JS & JQuery 動態(tài)添加 select option
- js select option對象小結(jié)
- JS獲取select-option-text_value的方法
- JS更改select內(nèi)option屬性的方法
- javascript據(jù)option的value值快速設(shè)定初始的selected選項(xiàng)
- js添加select下默認(rèn)的option的value和text的方法
- js獲取select選中的option的text示例代碼
- js獲取select默認(rèn)選中的Option并不是當(dāng)前選中值
- JS實(shí)現(xiàn)select選中option觸發(fā)事件操作示例
相關(guān)文章

JS/HTML5游戲常用算法之路徑搜索算法 A*尋路算法完整實(shí)例
這篇文章主要介紹了JS/HTML5游戲常用算法之路徑搜索算法 A*尋路算法,結(jié)合完整實(shí)例形式分析了A*尋路算法的具體實(shí)現(xiàn)技巧,代碼備有詳盡的注釋便于理解,需要的朋友可以參考下
2018-12-12 
js調(diào)用瀏覽器打印模塊實(shí)現(xiàn)點(diǎn)擊按鈕觸發(fā)自定義函數(shù)
把瀏覽器打印的功能保留并賦予到自己添加的按鈕當(dāng)中,可以在點(diǎn)擊按鈕的同時觸發(fā)自定義的函數(shù)
2014-03-03 
使用clipboard.js庫實(shí)現(xiàn)復(fù)制剪切功能
這篇文章介紹了clipboard.js實(shí)現(xiàn)復(fù)制功能的方法,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
2022-06-06 
JS設(shè)計(jì)模式之?dāng)?shù)據(jù)訪問對象模式的實(shí)例講解
下面小編就為大家?guī)硪黄狫S設(shè)計(jì)模式之?dāng)?shù)據(jù)訪問對象模式的實(shí)例講解。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
2017-09-09 
js實(shí)現(xiàn)tab選項(xiàng)卡函數(shù)代碼
js實(shí)現(xiàn)tab選項(xiàng)卡函數(shù)代碼,需要的朋友可以參考下,這樣的代碼也是比較常用的,相當(dāng)原理也比較簡單。
2010-04-04 
如何手動實(shí)現(xiàn)es5中的bind方法詳解
這篇文章主要給大家介紹了關(guān)于如何手動實(shí)現(xiàn)es5中的bind方法的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面小編來一起學(xué)習(xí)學(xué)習(xí)吧
2018-12-12