點(diǎn)擊按鈕切換文本我想循環(huán)給li綁定點(diǎn)擊事件,然后將文本放在數(shù)組中,點(diǎn)擊時(shí),替換成和li對(duì)應(yīng)下標(biāo)的文本相關(guān)代碼//請(qǐng)把代碼文本粘貼到下方(請(qǐng)勿用圖片代替代碼)Document*{margin:0;padding:0;}.box{width:400px;height:200px;margin:100pxauto;border-top:none;}.btn{overflow:hidden;display:flex;}.btnli{/*float:left;*/list-style:none;flex:1;text-align:center;height:50px;line-height:50px;border:1pxsolid#000;border-right:none;}li:last-child{border-right:1pxsolid#000;}.content{height:200px;padding:10px;border:1pxsolid#000;border-top:none;}按鈕a按鈕b按鈕c我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是誰(shuí)點(diǎn)擊我vartextArr=["我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字我是按鈕a的文字","我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字我是按鈕b的文字","我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字我是按鈕c的文字"]//使用JQUery方法var$lis=$('li')for(leti=0;i
Jquery實(shí)現(xiàn)選項(xiàng)卡,我這樣寫(xiě)為什么不行
慕運(yùn)維8079593
2019-04-27 22:16:17