Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Code a pop-up for a give away.

Hey guys,

I am trying to understand how easy/difficult is to code a pop up on the website that would allow a user to enter their email for a give away.

I have attached screenshot examples.

https://dl.dropboxusercontent.com/u/22201594/Screen%20Shot%202015-09-22%20at%2011.48.07%20AM.png https://dl.dropboxusercontent.com/u/22201594/Screen%20Shot%202015-09-22%20at%2011.48.15%20AM.png

3 Answers

Not so difficult, but you need javascript for opening this popup and some server side language to handle saving entered email to database or mailed to you.

So the best thing would be to start learning some javascript if you're happy with your html already.

Hi, there are several ways to do this. But you need JavaScript in order to code the action. A simple method would be the prompt method in Javascript, or a div overlay in HTML with CSS design, if you want it to look better. If you want to store the mail in a database, you need e.g. PHP with MySQL, so there are several parts, not that difficult, but a bit to learn. :)

Well you need to know More than html to make a pop up