$('<div id="click-pm">PM</div>').on("click", function() {
                    self.spanAmPm.children('#click-pm').addClass("text-primary");
                    self.spanAmPm.children('#click-am').removeClass("text-primary");
                    self.amOrPm = 'PM';
                }).appendTo(this.spanAmPm);