Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Oh noooo!</title>
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#myDiv").append($("<input />", {
- type : "button",
- id : "myButton1",
- value : "Click me first!"
- }));
- $("#myButton1").live("click", function () {
- var a = 1;
- $("#myButton2").click(function () {
- alert(a);
- });
- });
- });
- </script>
- </head>
- <body>
- <div id="myDiv"></div>
- <input type="button" id="myButton2" value="Click me!" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement