Dynamically Populating Tweet Button




I am working to create a superhero name generator for our site. I want people to be able to tweet the name they have generated with something like, “My superhero name is [dynamically generated name].”

Is there a way to pull the form result after clicking the “generate” button into a tweet button?

The form code will look as follows:



The JavaScript factory function will render a Tweet button based on the parameters you parse from the form and pass into its constructor.