Forum:How does mirror gate work?

hi, I'm new to dueling, and I decided to make a elemental hero deck (like jaden) and i was wondering how Mirror gate exactly worked? like, are the places just changed? and would i lose my monster if he was in attack position when my opponent attacked?...

i thought the way it worked was they switch places, and damage is calculated, but the monsters are not destroyed.. can anyone clear this up for me? (sorry if I'm asking a stupid question)