d
Amit DhamuSoftware Engineer
 

Prompt For User Input

1 minute read 00000 views
$('.button').on('click', function () {
  var name = prompt('Your Name?', 'Enter your name')
  if (name != null && name != '') {
    alert('Your name is ' + name)
  } else {
    alert('You did not enter your name!')
  }
})