How to center the message inside an alert box in JavaScript? -


suppose have alert message like:

alert("message"); 

when command executed, alert box pops message aligned left of alert box.

is there way center message inside alert box?

well, 1 thing should know can't style alert box. it's system object not css thing.


if still want use alert , want move text left right use \t, tab. can figure out how many characters you're going use on line , encase text in \ts.

eg:

\t text centered \t\n \t in middle of alert \t 

it's not perfect, it's close 1 can move text center in alertbox.

\t works perfect firefox not chrome. love chrome, web developer pain in neck.

my alert box looks messy without \ts. google need fix issue...

suggestion

so it's better to create own. example,

jquery ui dialog

have here : demo


the best thing used display message using toast messages. pops up, show message in beautiful box , pops out in sleek manner.

have @ materialize css toasts


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -