0

I have to show the message on alert box with font size - 6. I have done like below.

     var str = "Formatting some text.";
     str = str.fontsize("6").fontcolor("#006400").bold();
     alert(str);

But the output get as
<b><font color="#006400"><font size="6">Formatting some text.</font></font></b> Please help to correct the issue

user2431727
  • 877
  • 2
  • 15
  • 46

3 Answers3

1

I think No as per my knowledge as this is controlled by the browser

You would have to use a JavaScript based dialog windows alternative like jQuery UI Dialog.

there is another alternative to jQuery UI Dialog box is sweetalert

Rahul
  • 4,294
  • 1
  • 10
  • 12
0

It is possible to set bold text at alert()

alert("  .")

jsfiddle http://jsfiddle.net/7YgLB/10/

guest271314
  • 1
  • 15
  • 104
  • 177
-1

Use this code. It will help

HTML

<div id="Custom_Alert" title="Alert">
  <p style="font-size:6px">Formatting some text.</p>
</div>

JavaScript

$( function() {
  $( "#Custom_Alert" ).dialog();
} );
Gust van de Wal
  • 5,211
  • 1
  • 24
  • 48
mukesh kumar
  • 1
  • 1
  • 3