Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <script src="https://unpkg.com/prettier@1.13.0/standalone.js"></script>
  <script src="https://unpkg.com/prettier@1.13.0/parser-babylon.js"></script>
  <title>JS Bin</title>
</head>
<body>
  Input:<br />
  <textarea id="input"></textarea>
  <br/>
  <button id="format">Format!</button>
</body>
  <script type="text/javascript">
    var formatButton = document.querySelector("#format");
    var textInput = document.querySelector("#input");
    formatButton.addEventListener("click", function() {
      var value = textInput.value;
      textInput.value = prettier.format(value, {
        parser: "babylon",
        plugins: prettierPlugins
      });
    });
  </script>
</html>
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers