element.ptTimeSelect is not a function

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:

  1. $('#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:

  1.     $(document).ready(function () {
  2.         //make hours of operation textboxes into timepickers.
  3.         var elements = $("input[id *= '_timepicker']");
  4.         for (var k = 0; k < elements.length; k++) {
  5.             var element = elements[k];
  6.             console.debug(element);
  7.             element.ptTimeSelect();
  8.         }
  9.     });

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