Welcome Guest, Not a member yet? Register   Sign In
Javascript
#1

[eluser]ibnclaudius[/eluser]
I have this code:

Code:
$("#buttom-show-register-99").click(function () {
  $("#div-register-99").fadeIn(500);
  $('#buttom-show-register-99').attr('id', 'buttom-hide-register-99');
});

The div fadein, but the id of the button don't change. Why? Confused
#2

[eluser]Aken[/eluser]
You should leave the ID as-is and add/remove a class to specify if it should be hidden or not. You can also just hide it immediately with jQuery.
Code:
$('#button-show-register-99').click(function() {
$('#div-register-99').fadeIn(500);
$(this).hide();
});




Theme © iAndrew 2016 - Forum software by © MyBB