I have a peculiar question with regards to javascript pop-up window - alert or confirm pop-ups. These come with 'ok' or 'yes/no' buttons. In the pop-up, there is usually a cross on top-right side. How can I remove that cross?
Asked
Active
Viewed 56 times
-1
-
You mean the close button? You can't. – j08691 Feb 26 '14 at 14:16
-
If you would like to create your own pop-ups you should do so with overlay elements and/or popup windows. You cannot edit windows native elements from javascript, I believe. – dkasipovic Feb 26 '14 at 14:17
-
You can not modify them. Clicking the close button is same thing as cancel. – epascarello Feb 26 '14 at 14:17
-
You don't because the browser won't let you – CodingIntrigue Feb 26 '14 at 14:17
-
thank you all for the comments .... the first thing is we all can ... one of the developers has done it many places ... he is no longer with us, so we are now grappling with the issue as in one of the pages, the behavior of cross is not same as no (or cancel) ..... we use custom .js and .css .... let me know if you would like to see pages where it is removed – Aakash Goel Feb 26 '14 at 14:21
-
found a relevant answer .... helpful for others who think the question is not possible -> http://stackoverflow.com/questions/896777/remove-close-button-on-jqueryui-dialog – Aakash Goel Feb 26 '14 at 14:35
-
@AakashGoel — That is asking about jQueryUI Dialog, not `alert` or `confirm`. It's a different problem. – Quentin Feb 26 '14 at 14:39
3 Answers
1
In the pop-up, there is usually a cross on top-right side.
That depends on the browser or, more usually, the operating system the browser is running on.
How can I remove that cross?
As a page author, you cannot.
The closest you could come to be to implement your own dialogue using DOM.

Quentin
- 914,110
- 126
- 1,211
- 1,335
-
we have our own js/css ... so we are not using browser's standard pop-up ..... one of the developers has done it at many places ... he is no longer with us, so we are now grappling with the issue as in one of the pages, the behavior of cross is not same as no (or cancel) – Aakash Goel Feb 26 '14 at 14:22
-
@AakashGoel — Your question says you are using `alert` and `confirm`. If that isn't the case, then you are asking the wrong question and you should ask a new one showing the code you are actually using (which will be implementing your own dialogue using DOM as I suggested in this answer). – Quentin Feb 26 '14 at 14:38
0
You could use Bootstrap popovers/modal... http://getbootstrap.com/javascript/#popovers
There are a lot of others to choose from as well.
Then you would have full control over your ui.

nrd
- 106
- 1
- 7