Reputation: 2846
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!
Upvotes: 0
Views: 37
Reputation: 85545
You're forgetting to close the ready handler:
$(document).ready(function() {
$('#trigger-modal-editor').click(function() {
alert('Hello');
});
});//this
Also, you don't have any text inside #trigger-modal-editor
, place some text there to click in.
Upvotes: 1