This must be something I\'m overlooking, but please look at the following page and JavaScript and tell me why, for everything that\'s holy, jQuery won\'t return true?
<
You had your script in the hello1 but the element
in .
First you should use $(document).ready() to make sure the content is loaded. Then check if they are equal using .is().
$(document).ready(function() {
var t = $('.test');
var s = $('.test');
console.log(t);
console.log(s);
if (t.is(s)) {
console.log('yes');
}
});
Compare the examples with and without the .ready()
function.