How to make a div active and background transparent?

How to make a div active and background transparent?

I'm working on a page that requires a captcha div to show up when a button is clicked. And after the button is cilcked, I want the captcha div to show up in front of the form, and the form on the back should appear transparent along with all the body except the captcha div itself. Can somebody help me out? Just the logic is acceptable, I don't need the code.