Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log html to console - Javascript [duplicate]

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

like image 569
Ali Faris Avatar asked Sep 04 '25 04:09

Ali Faris


1 Answers

Try this

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

you cand find all by googling customize javascript console

like image 164
FarukT Avatar answered Sep 05 '25 23:09

FarukT