Javascript console.warn() Method

Introduction

Write a warning to the console:

console.warn("This is a warning!");

Press F12 on your keyboard to view the message in the console view.

View in separate window

<!DOCTYPE html>
<html>
<body>
<script>
console.warn("This is a warning!");
</script>//from w  w w. j  a  v a2 s . c o  m

</body>
</html>

The console.warn() method writes a warning to the console.

console.warn(message);

Parameter Values

Parameter Type Description
message String or Object Required. The message or object to write as a warning



PreviousNext

Related