Thanks for your question!
Let's say for example the code that is generate is for optimizely.com and it provides the following:
We can take what's located inside of the onclick attribute and set that as an attribute to the element in which we want to generate the pop-up after clicking. For instance, let's say we want to generate this pop up of optimizely.com after clicking on a paragraph element. Using jQuery, this would look like:
I hope this helps!
Manager, Technical Support
(I suggest checking the option here "Build up a string variable that you can use later" over the other two options that offer the usage of document.write, which should never ever be used)
UI Developer @ Blue Acorn