element.ptTimeSelect is not a function
Hey all,
I'm using the ptTimeSelect time picker plugin and it's really nice. If I set up a textbox as a time selector like this:
- $('#mydatepickerid').ptTimeSelect();
it works fine. However, I have a lot of time pickers on the page and want to loop through them and set all of them up in one loop. Here's my javascript:
- $(document).ready(function () {
- //make hours of operation textboxes into timepickers.
- var elements = $("input[id *= '_timepicker']");
- for (var k = 0; k < elements.length; k++) {
- var element = elements[k];
- console.debug(element);
- element.ptTimeSelect();
- }
- });
This code correctly grabs all of the input elements that have an id with _timepicker in it, however when it calls .ptTimeSelect() on one it errors out:
element.ptTimeSelect is not a function
What am I doing wrong?
Thanks,
Justin