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">
  <title>JS Bin</title>
  <script src="https://cdn.jsdelivr.net/riot/3.0.5/riot+compiler.min.js"></script>
</head>
<body>
  <app>
    <child />
  </app>
  <script type="riot/tag">
    <app>
      <h1>in app</h1>
      <yield />
    </app>
    <child>
      <button onclick="{ toggle }">toggle</button>
      <p show="{ selected }" style="height:{ height };">should be hidden when inited</p>
      
      this.selected = false
      this.height = 'auto'
      this.toggle = ()=>{
        this.selected = !this.selected
      }
    </child>
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers