為什么會出現Uncaught TypeError: Cannot read property 'css' of undefined 錯誤
在按下回車鍵的功能里,加入判斷目前選定的是哪一個a時使用了as[i].css('color')=='rgb(221,221,221)',出現了Uncaught TypeError: Cannot read property 'css' of undefined ?的錯誤
在按下回車鍵的功能里,加入判斷目前選定的是哪一個a時使用了as[i].css('color')=='rgb(221,221,221)',出現了Uncaught TypeError: Cannot read property 'css' of undefined ?的錯誤
2016-03-14
舉報
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后,報錯Uncaught TypeError: Cannot read property 'style' of undefined;但是style.display卻不報錯,請教下這是為什么?
2016-03-15
謝謝!加載了jq.js就可以使用了,對吧
2016-03-14
as[i].style.color == 'rgb(221,221,221)'; ? ? js中沒有.css的方法,jq中有的。。