How to increase font size in javascript alert ()

Can I control the font size of a string in a javascript alert() call ??!

I have the image below and I want to increase the font size so that it is legible.

Javascript Alert Pop Up

+8
source share
4 answers

Can I control the font size of a string in a javascript alert () call ??!

Nope. How the warning window is rendered is completely browser dependent.

You will need to use alternative JavaScript-based dialog boxes such as jQuery UI Dialog.

+15
source

No, this is controlled by the browser. I no longer use alerts. I am using jQuery UI dialog , fully customizable

+2
source

As far as I know, this is not possible.

However, you have several options:

If you want to create it yourself as a completely ordinary thing, create a new div in your DOM (as the last child of the body and specify the maximum z-index that you can use or use), a position that is absolute (top: 0, left: 0), and write there HTML what you want. With some JS you can position it in the center of the screen / layout. :)

Or use jQuery UI Dialog ... :)

+2
source

Wait, so there is no way to do this without knowing jQuery, which I have no idea how to use ... so can anyone tell me what the syntax for the UI dialog is?

0
source

Source: https://habr.com/ru/post/891563/


All Articles