Using a script that reference jQuery Mobile I have the following line:
<a href="#" id="buttonAnswer1" data-role="button" data-inline="true" >check</a>
How would I add a listener for when this button is clicked and lets say call the hello() function? i.e.
<a href="#" id="buttonAnswer1" data-role="button" data-inline="true">check</a>
<script>
function hello(){
console.log("hello world");
}
</script>
This isn’t really any different then regular jQuery, that is you can use .on to bind an event handler
For example, using .on with event delegation
Or you can bind it directly