问题描述:

I am facing a great problem . I am working on a project..Online food booking..In this project I want to add menu and their price by selecting their corresponding checkbox..I want to fire ajax when one checkbox is checked. How can I fire Ajax on checkbox checking?

网友答案:

You only need to use the "change" function in your checkbox to trigger the function that you want, like this:

<script>
jQuery(document).ready(function($) {
    $('#your-checkbox').change(function(e) {
        /* Your ajax call goes here */
    });
});
</script>
相关阅读:
Top