Using jQuery UI in a Bookmarklet
In CoffeeScript, though this code is almost identical to JavaScript: tabs_html = "<div id='nm-container'><ul><li><a href='#tabs-1'>Guidelines</a></li><li><a href='#tabs-2'>Test</a></li></ul> <div id='tabs-1'><p>something1</p></div><div id='tabs-2'><p>something2</p></div></div>" $("#nm-toolbar").append(tabs_html) $("#nm-container").tabs() It doesn't work. Funny thing is it does work when trying the last line: $("#nm-container").tabs() from the console. I'm attaching the full code below. Note that I'm using CoffeeMarklet to generate the bookmarklet which seems to work only on chrome. s1 = window