+ 12
How to format text in JavaScript alert.
alert("this is the formatted text"); i want the text in the alert to be of color green ,justified and bold.
9 Réponses
+ 6
oh come on guys atleast there must be some thing i can do maybe to create functions that return the formated text
+ 5
You can't, its impossible. You don't get control over the OS styling of a browsers alert window. Im sure there would be a way using javascript and a ton of code but it wouldn't work for every browser and operating system and would be buggy as heck. You are best to draw your own alert modal window and style that instead. I really like using sweet alert, have a look into that.
+ 5
A modal box gives you creative control.
https://code.sololearn.com/WFC0N5D1V2S7/?ref=app
+ 2
you can't do it
+ 2
meh, sorry for disspointing but you still can't
+ 2
alert prompt and confirm we can't style
+ 1
you can use sweet alert library, and then modify it
+ 1
you can use sweet alert, and then modify it. here is the link: https://lipis.github.io/bootstrap-sweetalert/
+ 1
I have a new solution. You must do your own div element and button to set their visibility. Check this out!!|||
https://code.sololearn.com/WRv8dD8M7j9M/?ref=app