I need to execute a javascript, but I would like to do this using the ID of the button that clicked,
Example:
$ (document) .ready (function () {
$("p").click(function(){
alert("estou usando o P.");
});
$('teste').on('click',function(){
//eu precisa de alguma coisa assim
alert("estou usando o id.");
});
});
How to use reference id?
In this example only works when using the "P" tag
Thank you