0
此代碼尚未完全完成。我試圖遍歷頁面內的所有'm'變量,直到頁面內沒有更多'm'變量。現在我有'for(m in document)',我知道這是錯誤的。任何人都可以指出我的正確方向嗎?對於文檔中的變量(Javascript)
var m = document.getElementsByClassName('project')
var n = document.getElementsByClassName('web')
var o = document.getElementsByClassName('print')
var p = document.getElementsByClassName('illustration')
function projectFilter(type){
if (type === 'print'){
for (m in document){
if (getElementsByClassName('print') != null){
m.style(opacity=0.3)
console.log("Whatshappening")
}
}
if (type === 'web'){
console.log('webbyshit')
}
if (type === 'illustration'){
console.log('illustrating')
}
if (type === 'project'){
console.log('EVERYTHING')
}
}
謝謝!