이 코드는 아직 완전히 완성되지 않았습니다. 나는 페이지 내에 더 이상 'm'이 없을 때까지 페이지 내의 모든 'm'변수를 반복하려고합니다. 지금 당장 나는 틀린 것으로 알고있다. 누구든지 정확한 구문에 대한 올바른 방향으로 나를 가리킬 수 있습니까?문서의 변수 (자바 스크립트)
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')
}
}
고마워요!