Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<head>
<meta charset=utf-8 />
<title>HTML5 Notifications</title>
  <script>
    function authorize() {
      Notification.requestPermission(function(perm) {
        alert(perm);
      })
    }
    
    function show() {
      var notification = new Notification("This is a title", {
          dir: "auto",
          lang: "",
          body: "This is a notification body",
          tag: "sometag",
      });
      
      // notification.onclose = …
      // notification.onshow = …
      // notification.onerror = …
    }
  </script>
  
  <button onclick="authorize()">authorize</button>
  <button onclick="show()">show</button>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers