differentiate the return statements
Hello friends i have three buttons.
i want that when i click Hi button the event handler for all the button type should skip the executing the handler for this button.
but for other buttons the handler should execute.
however i make this but the handler is executing for hi button too.
i tried return statements with true,false and nothing but it is not skiping the handler.
That is why i could not differentiate between the return true,false and only return.
please help regarding this and solve my problem.
HTML--
<div>
<button type="button">Hello</button>
<button type="button">Hi</button>
<button type="button">Hey</button>
</div>
JAVASCRIPT--
<script type="text/javascript">
$(document).ready(function () {
$(":button").click(function () {
if ($(this).val() == "Hi") {
return false;
//return true;
//return;
}
$(this).html("<p><b>Another</b></p>");
});
});
</script>