Add class to signup page form fields with jQuery
-
I am trying to add a unique class to each label field on the default wp-signup.php page.
Here is the code I have right now and its not working:
//Add unique class to signup form label function ra_add_tags(){ ?> <script type="text/javascript">$('form').find('label').addClass('mynewclass');</script> <?php } function ra_add_tags_classes () { add_action('wp_head','ra_add_tags', 99); } add_action('signup_header','ra_add_tags');
I realize that function doesn’t take into account my need for unique classes for each label, but I cannot seem to even get it to add the class of mynewclass to all of them at once.
I have verified that my jquery is coming after jquery is loaded in the head.
I just think my function maybe firing before the actual page has generated the <form> html
Thoughts on how I can get this to work? And how I can make it so that it automgically makes them unique to each label too?
Thanks
- The topic ‘Add class to signup page form fields with jQuery’ is closed to new replies.