use jquery to get the element of a class, the console prints out jQuery.fn.init (0), and does not get the element of this kind of selector, how can I get it? Use jquery to get the HTMLCollection () collection?
Native JavaScript prints out HTMLCollection ().
jquery prints out jQuery.fn.init (0).
attach my code
var e = document.getElementsByClassName("star");
console.log(e);
$(document).ready(function(){
console.log($(".star"));
$(".star").click(function () {
$(this).css = ("color", "-sharp00F7DE");
console.log($(this).tagName);
});
});