I'm trying to make an event listener for when a button is 'active' (has an .active class in my case) and a link is clicked, an event happens. But I'm having trouble chaining the two conditionals together and it doesn't seem to work.
if($('.talk').hasClass('active') && $('.goblin').click()){
alert("the world has gone mad!");
} else {
//nothing happens
}
The code is above. Again, the two conditions are:
*The 'Talk' button is active
*The link with class 'Goblin' is clicked
I'm thinking I'll have to use .live() or something for this, but I'm not sure. Help!
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)