How can I change paragraph order using jQuery?
on this registration page http://energies2050.org/wp-login.php?ac开发者_高级运维tion=register i would like to change the order of the paragraphs to be:
Identifiant
Civilite :
First Name:
Last Name:
Telephone:
About Yourself:
Motivation pour participer au Forum:
Sujets que vous aimeriez voir sur le Forum:
Password:
Confirm Password:
Disclaimer
Would that be doable in jQuery?
Check out the Manipulation part of JQuery API. You will find the functions you need in this context.
What i did
jQuery("#registerform > p").addClass("register");
var p = 0;
jQuery('#registerform').find('p').each(function(){
if(p<100){
p++;
}
else{
p = 1;
}
jQuery(this).addClass('p-' + p);
});
jQuery("#registerform .p-9").insertBefore("#registerform .p-1");
精彩评论