為什么會(huì)出現(xiàn)Uncaught TypeError: Cannot read property 'css' of undefined 錯(cuò)誤
在按下回車鍵的功能里,加入判斷目前選定的是哪一個(gè)a時(shí)使用了as[i].css('color')=='rgb(221,221,221)',出現(xiàn)了Uncaught TypeError: Cannot read property 'css' of undefined ?的錯(cuò)誤
在按下回車鍵的功能里,加入判斷目前選定的是哪一個(gè)a時(shí)使用了as[i].css('color')=='rgb(221,221,221)',出現(xiàn)了Uncaught TypeError: Cannot read property 'css' of undefined ?的錯(cuò)誤
2016-03-14
舉報(bào)
2016-03-15
哦,沒有color='rgb(221,221,221)'的吧,color是文字顏色的屬性,你寫的'rgb(221,221,221)'是想寫背景顏色的吧。。
要么style.color == ‘#999’或者?style.background =='rgb(221,221,221)'
2016-03-15
改為style.color后,報(bào)錯(cuò)Uncaught TypeError: Cannot read property 'style' of undefined;但是style.display卻不報(bào)錯(cuò),請(qǐng)教下這是為什么?
2016-03-15
謝謝!加載了jq.js就可以使用了,對(duì)吧
2016-03-14
as[i].style.color == 'rgb(221,221,221)'; ? ? js中沒有.css的方法,jq中有的。。