can we set condition on event type like if event is click then alert ‘clicked’ if event if mouseover then alert ‘over’. but my function is alerting value when function is loading on the page
<head>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function() {
if($('.wait').click()) {
alert('click')
}
else if ($('.wait').mouseenter()) {
alert('mouseenter')
}
})
</script>
<style>
.wait {color:#F00}
.nowait {color:#00F}
</head>
<body>
<div class="wait">abc.....</div>
<div class="wait">abc.....</div>
<div class="wait">abc.....</div>
</body>
try this