Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible"
- content="IE=edge">
- <title>Page Title</title>
- <meta name="viewport"
- content="width=device-width, initial-scale=1">
- <script src="main.js"></script>
- </head>
- <body>
- <button id="name">Click me</button>
- <script>
- let myButton = document.getElementById('name')
- class Test {
- constructor() {
- this.userSelection = 'none';
- }
- assignValue(selection) {
- this.userSelection = selection;
- }
- selectCharacter() {
- }
- }
- let myTest = new Test
- myButton.addEventListener("click", () => {
- myTest.assignValue(myButton)
- console.log('in')
- console.log(myTest.userSelection)
- })
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment