This is my problem. Every time I load the page, I get an alert message with “Click” and I just can’t understand what am I doing wrong. I have not clicked. Same happens with mouseover or any function I add.
<script>
$jq().ready( function(){
$jq( ".clickable" ).click( alert( "Click" ) );
// Hide all the questions and answers
$jq( ".faq-section" ).each(
function(){ $jq(this).css( "display", "none" ); }
);
});
</script>
I apologise if this is an stupid question.
It is because of this line
$jq( ".clickable" ).click( alert( "Click" ) );. Instead of passing a function reference you are calling the function here.Change it to