I am using javascript to generate a div witch i want to use Perfect Scrollbar and i cannot catch it with its id to initiate the plug in. I know how to do it if i want to bind an event but i am confused about this. Here i generate the div
var search = $('<div id="search-container"><h2>SEARCH VOICES BY NAME</h2> <input type="text" size="30" id="voice-inp"><div id="search"></div></div>');
And the initiate code:
var search = $('#search');
Ps.initialize(search);
EDIT. I catch the element now but i get this error Uncaught TypeError: Cannot read property 'split' of undefined.