js alert message code example
Example 1: how to send an alert in javascript
function mousePressed() {
alert("I'm the best");
}
function keyPressed() {
if (keyCode === UP_ARROW) {
alert(number = random(0, 500));
}
}
if(x > width) {
alert("yay you did it");
}
Example 2: javascript alert
alert("string");
Example 3: javascript alert
alert(varible);
Example 4: js alerts
3 types of JS Alerts
- Information : You can only accept.
- Confirmation: You can accept or decline.
- Prompt : You can accept, decline, and/or sendKeys.