jquery - How can I get button events in the following code? -


i new jquery , don't know how events when press button on following code. please me.

<div class="key">     <div class="buttonwrapper">             <span data-i18n="keypad.one" class="button i18n"></span>     </div> </div> 

first want capture element want use, using $(). in case:

$(".button") 

then after have gotten element using $() want bind event it. in case .click() event:

$(".button").click(function(){    // insert want happen when clicks button here }); 

to learn more jquery, recommend looking @ api. more information .click() event click here. learn more events in general click here.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -