I have 4 div which has this is li#click, and i want to get the class of this id. I am trying to get class from de current div, but it come undefined. i use "this" to get class on the clicked div only, because is there more div with the same function
i use the jquery function .attr('class') to get the class using the "this" keyword. on the first time it work fine, but when i restart de pc it does not work anymore
$(document).ready(function(){
// code para about device drop panel
$( "li#click" ).click( () => {
var classi = $(this).attr('class')
alert(classi)
let q = `#${classi}`
$(q).toggleClass( "dados2" )
});
});
i trying to get a class a name but it come undefined