Possible Duplicate:
Changing the way a JavaScript Alert() or Prompt() looks
I have a string in my JavaScript code here:
_msg = "You have errors on Question Number: " + _qid + "\n";
I am displaying _msg
using alert
.
How can I make it bold?
Possible Duplicate:
Changing the way a JavaScript Alert() or Prompt() looks
I have a string in my JavaScript code here:
_msg = "You have errors on Question Number: " + _qid + "\n";
I am displaying _msg
using alert
.
How can I make it bold?
Your answer is way too vague to know what you're actually doing with that string, but in the off chance you're just sticking it in the DOM somewhere:
_msg = "<b>You have errors on Question Number: " + _qid + "</b>\n";
Edit: You're displaying it in an alert, sorry there isn't any control over the formatting in that case.
You can't style HTML content in alert pop-ups.
Your best bet is looking into a custom pop-up, which you can style with CSS and toggle with Jquery.
This tutorial is fairly simple as it only requires the Jquery library:
http://webdesignersdesk.com/2010/05/create-custom-popup-model-window-with-jquery/
There are also several plugins available for custom pop-ups too.
You cannot bold text in an alert
. Sorry.
However, you can add something in the DOM that looks like an alert.