Gibbs
Gibbs

Reputation: 22956

Hiding a div or appending it dynamically

I have a register/login form. My current design is as follows

 <div class="container">
    <form class="register">
    </form>
    <form class="login">
    </form>
 </div>

I am using Jquery to show/hide divs.

Another approach could be

  <div class="container">
      //Empty Div
  </div>

Append/Remove divs dynamically when user clicks register/login button.

Which one is the best over anohter? What are the pros and cons of these methods. Any suggestions?

Upvotes: 0

Views: 46

Answers (1)

Andre Pena
Andre Pena

Reputation: 59336

I think appending/removing the divs would be the worst solution because that would clear the state of the forms.. Like.. The user would lose information if he/she decided to go from one form to the other. But generally, they are both acceptable.

Upvotes: 1

Related Questions