im fairly newb when it comes to writing pure javascript, but i want to learn and become better. i have a code below, what im trying to do in the if block doesnt matter so much, but what is tripping me up is using "this". below i want wrap to have classname if condition is true, but its not working. Can anyone please explain why is "this" not working in my code below?
var wrap = document.getElementById("wrap")
if(wrap.innerHTML.length === 0){
this.className="empty"
}