/*not working*/
console.log(document.getElementById("id"));
/*working*/
console.log(document.getElementById(" id"));
/*working*/
console.log(document.getElementsByClassName("class1")[0]);
/*working*/
console.log(document.querySelector('.class1'));
/*working*/
.class1{
color: red;
}
/*working*/
div[id=' id'] {
text-align: center;
}
/*not working*/
#id{
background-color: yellow;
}
/*not working*/
# id{
font-size: 300%;
}
<div class=" class1" id=" id">This is a div</div>
Developers always make it work. 🙂
1
solved Impact on space on class / id [duplicate]