jhon1024 jhon1024 - 10 days ago 5
Javascript Question

How could i hide a word in javascript in this code?

Im trying to hide

twox2
word with this code below but this dont work

$("#twox2").hide;

var count=0
$("#name2x, #twox2").mouseenter(function(){
count++;
$("#show").hide();
}).mouseleave(function(){
count--;

setTimeout(function(){
if (count==0){
$("#show").show();
}
},50);
});


Thanks.

Answer

Because hide() is a function, not a property. Simply add parentheses after your first line:

$("#twox2").hide();