3

I'm trying to log html to the browser's console in order to notify user, for example, when user open developer tools a header logged to console.

Just like Facebook

enter image description here

I have tried this,

console.log('<h1 style="color : red">Pay Attention</h1>');

but it's logged as string

Fenil Patel
  • 1,244
  • 8
  • 21
Ali Faris
  • 13,532
  • 6
  • 31
  • 54

1 Answers1

5

Try this

console.log('%c Stop ', ' color: red; font-size:28px;');

you cand find all by googling customize javascript console

Anjana Silva
  • 5,175
  • 3
  • 40
  • 45
FarukT
  • 1,150
  • 8
  • 17