Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//fb.me/react-0.12.2.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <div id="content"></div>
</body>
</html>
 
var Link = React.createClass({
    render: function() {
        return (
            <div>
                <a href="http://google.com" onClick={this.handleClick.bind(null, 'Google')}>Google</a>
                <br />
                <a href="http://facebook.com" onClick={this.handleClick.bind(null, 'Facebook')}>Facebook</a>
            </div>
        );
    },
    handleClick: function(linkName, e) {
        e.preventDefault();
        alert('You clicked ' + linkName);
    }
});
React.render(<Link />, document.getElementById('content'));
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers