It's probable that your chat script is adding #cometchatbase to the DOM in the "onload" event handler, if it's not happening at script evaluation time. Check it's source to confirm. If that's the case, you should be able to use
$(window).load(function(){ $('#cometchatbase'). }); instead of $(document).ready(function(){... cheers -- ricardo On Jul 13, 4:12 am, Veeru <swamyve...@gmail.com> wrote: > I have an example for the scenario > I am using cometchat in my application. > Its a third party script, that provides a chat interface to the > website. It adds some containers to the body of the document. One such > container is cometchatbase. > > I want attach something to this container on document.ready. But by > the time document.ready is fired, the container is not generated, so $j > ("#cometchatbase") returns null. Does this mean, before the > cometchat.js has finished executing document.ready has already fired? > > Thanks > Vru