jquery - check if clicked element has css class

other
voted: 0
vote
class element

Checking if clicked element has class with particular name.

<script type="text/javascript">
    $(document).on('click', '#element_id', function (e) {
        if ($(this).hasClass('class-name')) {
            // has class
        }
        else {
            // has no class
        }
    });
</script>
working url: not entered
version: not entered
Leave a Comment:
Characters left:
No comments yet.