File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
023 Eventos raton Teclado Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 2525
2626const button = document . getElementById ( 'button' )
2727const box = document . getElementById ( 'box' )
28+ const input = document . getElementById ( 'input' )
29+
2830box . addEventListener ( 'mouseenter' , ( ) => {
2931 box . classList . replace ( 'red' , 'green' )
3032} )
3133 box . addEventListener ( 'mouseleave' , ( ) => {
3234 box . classList . replace ( 'green' , 'red' )
35+ } )
36+
37+ box . addEventListener ( 'mousedown' , ( ) => {
38+ console . log ( 'has pulsado en la caja' ) ;
39+ } )
3340
41+ box . addEventListener ( 'mouseup' , ( ) => {
42+ console . log ( 'HAS SOLTADO EL BOTON IZQUIERDO EN LA CAZA' ) ;
3443 } )
3544
45+ input . addEventListener ( 'keydown' , ( ) => {
46+ console . log ( "Has puldado una tecla" )
47+ } )
48+
49+
Original file line number Diff line number Diff line change 1111<!-- <a href="https://developer.mozilla.org/en-US/docs/web/events"> Google de eventos(ingles)</a>-->
1212
1313 < div id ="box " class ="box red "> </ div >
14+ < input id ="input " type ="text ">
1415 < button id ="button "> Click me! </ button >
1516 < script src ="JavaScript.js "> </ script >
1617</ body >
You can’t perform that action at this time.
0 commit comments