click event on a link doesn't work in jquery
问题 if element has class user i need to click on a link. the alert executes but link don't work. function gotoproduct() { var id = $(this).attr('id'); if($(this).hasClass("user")) { alert(""); // alert works. $('#mainnavi li a[title = "users"]').click(); // it's not working } else { window.location.replace("../"+tab+"/product.php?subjectid="+id+""); } } html: <div id="mainnavi" title=""> <ul style="margin-top:10px;"> <li><a title="phones" href="../phones/firstpage.php" >گوشی</a></li> <li><a title