I am having a hard time accessing a click even with my jQuery selector. Here is my HTML:
<li class="handle-bars">
<span class="fa fa-bars pull-right text-primary m-t-10"></span>
<span class="fa fa-cogs pull-right text-primary m-t-10" id="trigger-modal-editor" style="cursor:pointer" data-target="#modalSlideLeft" data-toggle="modal"> </span>
</li>
Here is my jQuery selector:
<script>
$(document).ready(function() {
$('#trigger-modal-editor').click(function() {
alert('Hello');
});
</script>
This is not registering the art for some reason. Any help is appreciated!
$(document).ready(function() { ... });though. If the elements are dynamically generated, use event delegation.