Home > Software engineering >  How to change certain part of alert message color and font in Java script
How to change certain part of alert message color and font in Java script

Time:06-04

I have been trying to change certain part of text to bold and red color.

It's not working on Microsoft Edge.

My code:

alert("Hi how are you my friend");

Need to make text : "friend" as bold and red color

I tried this but does not work

alert("Hi how are you my <b> <background-color = red"> friend </b>);

Any solution is much appreciated

CodePudding user response:

It is impossible i searched for this problem a lot, but you can make your window ,it isn't hard to find tutorials.

e.g https://www.delftstack.com/howto/javascript/javascript-customize-alert-box/

CodePudding user response:

Unless you use the dialog tag in jQuery to create the alert,it somehow has been styled in the jQuery theme already.... Styling JavaScript alert box on my end here I don't think it's possible

  • Related