Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- var x = 1;
- document.addEventListener(
- 'input',
- function(e) {
- if (e.target.value === 'easy') {
- console.log(x);
- x = 0;
- console.log(x);
- } else if (e.target.value === 'medium') {
- x = 1;
- console.log(x);
- } else if (e.target.value === 'hard') {
- x = 2;
- console.log(x);
- }
- },
- false
- );
- console.log(x);
- */
- var x = undefined;
- document.addEventListener(
- 'input',
- function(e) {
- if (e.target.value === 'easy') {
- x = 0;
- } else if (e.target.value === 'medium') {
- x = 1;
- } else if (e.target.value === 'hard') {
- x = 2;
- }
- },
- false
- );
- console.log(x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement