I have the following template containing a calendar icon in a javascript file. It doesn't appear in my html file because it's used dynamically.
var iconTemplate = '<li id=\"{streamID}\" class=\"list\">{streamName} <i class="fa fa-calendar pull-right"></i></li>';
I want to add a click event to the calendar icon and open date picker. I tried the following:
$('.fa-calendar').click(function(){
$(this).datepicker();
});
I'm guessing that this doesn't work because it's not calling on a class from the html file. Is it possible to do this all within a javascript file?
$(document).on('click, '.fa-calendar', function(){
...
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments