Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

alert confirm prompt javascript

  if (confirm("Press a button!")) {
    console.log("Accepted")
  } else {
    console.log("Declined")
  }
Comment

Function Alert,confirm,prompt

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction()">Try it</button>


<script>
function myFunction() {
    var name = prompt("Please enter your name", "XYZ");

    if (name != null) {
       alert('Your name is ' + name )


    }
}
</script>

</body>
</html>
Comment

confirm prompt alert

// confirm, prompt, alert is popup

// confirm 
confirm("Are you still alive?")

// prompt
prompt("Enter your name")

// alert
alert("You are a nice person")

// confirm is used for ask ok or cancel if person says ok then ok return true if person says cancel then it will return false
// prompt is use of asking text and it will return that text
// alert is to popup a message 
Comment

Confirm alert

$.alert({    title: 'Alert!',    content: 'Simple alert!',});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to hash password in node js 
Javascript :: map dictionary javascript 
Javascript :: node readFileSync json 
Javascript :: joi email validation regex 
Javascript :: get text in select jquery 
Javascript :: leaflet change zoom button position 
Javascript :: how to filter an array to only get numbers 
Javascript :: javascript csv string with commas in fields 
Javascript :: javascript screen width 
Javascript :: js deep copy array 
Javascript :: javascript change url without reload 
Javascript :: typescript round 
Javascript :: get the last option from select jquery 
Javascript :: angular build with configuration 
Javascript :: jest check buffer 
Javascript :: play iframe video onclick a link javascript 
Javascript :: jquery datepicker change date format 
Javascript :: set auto-hide toast javascrpt 
Javascript :: mysql get json value by key 
Javascript :: useswr 
Javascript :: how to select a random value in a json array LUA 
Javascript :: jasmine check if service was called only once 
Javascript :: detect mi browser 
Javascript :: http get request in javascript 
Javascript :: angular input date binding on variable update 
Javascript :: nodejs check directory exist or not 
Javascript :: nodejs btoa 
Javascript :: vs code prevent auto grml closing in js files 
Javascript :: how to understand if nodejs is out of memory 
Javascript :: find array object value is already in use 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =