The code inside the tag should be instantiated when the user action (for example, a button click) is complete. It could be wired up directly to an onclick event or wrapped inside a JavaScript function that is wired to the onclick event.