A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Create Alert Window with saying Yes or No. If user want to close current alert window as well as Previous Page, then user should press Yes. Otherwise press NO to remain at previous page?

As we know JavaScript is the heart of web Application, and so that we need to create two functions in JavaScript inside your head tag section of html/jsp page.
Functions should be as below:
Function Yes_fun(){

The above function will be called for YES button.
Create another function for No button called.

Function No_fun(){

Now , write both functions inside script tag and called with button onclick.

For parent page if you want to create button onclick with open new page, then write function as below.

Function Mt function(){