File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="es ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Objeto Evento</ title >
6+ < link rel ="stylesheet " href ="styles.css ">
7+ </ head >
8+ < body >
9+ < form id ="form ">
10+ < input id ="input " type ="text ">
11+ < input type ="submit " value ="enviar ">
12+ </ form >
13+
14+ < script src ="script.js "> </ script >
15+ </ body >
16+ </ html >
Original file line number Diff line number Diff line change 1+ const form = document . getElementById ( 'form' ) ;
2+ const input = document . getElementById ( 'input' ) ;
3+
4+ // input.addEventListener('keyup',(e)=>{
5+ // console.log(e);
6+ // });
7+
8+ // addEventListener('click',(e)=>{
9+ // console.log(e.clientX,e.clientY);
10+ // })
11+ input . addEventListener ( 'keyup' , ( e ) => {
12+ if ( e . key === 'x' ) {
13+ console . log ( e . key ) ;
14+ }
15+
16+ } ) ;
Original file line number Diff line number Diff line change 1+ a ,
2+ button {
3+ display : block;
4+ }
5+ .box {
6+ width : 100px ;
7+ height : 100px ;
8+ background : red;
9+ }
10+ .red {
11+ background : red;
12+ }
13+ .green {
14+ background : green;
15+ }
You can’t perform that action at this time.
0 commit comments