Hi Neeraj,
The reason behind this cause is called "<b>Event Bubbling</b>" in JavaScript. It means the Browser catches the event for every underlying element on a particular point. in order to override this behavior, add these code lines after you code in JS function which is being called on button1 click but just before the closing parenthesis of the function:
function stopEvent(evnt) {
if (evnt.stopPropagation) {
evnt.stopPropagation();
}
else {
evnt.cancelBubble = true;
}
}
the code above will prevent the event bubbling after the code inside your js function is executed.
Hope this helps!
Happy Coding:)
Sunny K