using jscolor.js on dynamic input

前端 未结 4 1471
说谎
说谎 2021-01-04 16:23

i\'m using color picker from http://jscolor.com/

i\'m trying to attach it to some dynamic inputs, but to no avail. dynamic inputs in terms of, on page load the input

4条回答
  •  没有蜡笔的小新
    2021-01-04 16:48

    For some reason jscolor.init() did not work for me, and looking at the code I called

    jscolor.installByClassName("jscolor");

    function.

    So...

    $(document).ready(function() {
      jscolor.installByClassName("jscolor");
    });
    

    Hope it helps

提交回复
热议问题