It’s a general WordPress issue. When you switch from the Text tab to the Visual tab the TinyMCE editor rewrites your HTML.
For all general WordPress support please ask in the appropriate WordPress support forum. → http://wordpress.org/support/
NOTE: To include code in your posts such as shortcodes, HTML, CSS, JavaScript, PHP → please follow the instructions on the forum home page. I have edited your post to wrap the HTML in the necessary tags so that we can all now see the HTML that you included in the post.