Click here to Skip to main content
15,888,014 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to change the class names for all the labels.

if i change one to one it takes me more time.

i need to find the label for the css class i have given..

so that i can append new class to it..

Please any one help me...
Posted
Comments
vinay.tatipamula 26-Aug-13 7:00am    
send the code what you have tried till now.
nandakishoreroyal 26-Aug-13 7:55am    
I have no idea Mr Vinay.

I did only to specific label...

but i need to get all the labels...
vinay.tatipamula 26-Aug-13 8:59am    
Hi.. nandakishoreroyal.. !
i assumed that you need all the labels in your masterpage to change the class names associated.

posted jsfiddle link(http://jsfiddle.net/Jb3XM/).. please check..

search for the classname which u have assign to your lables
 
Share this answer
 
Comments
nandakishoreroyal 26-Aug-13 7:54am    
Dear ashishbisen,

I cant search and add..

Is there any possibilities to change styles for the labels in master page/..
Hi check this ..http://jsfiddle.net/Jb3XM/[^]
 
Share this answer
 
Hey,

Try this one on document.Ready or on any click event if you want.

$('#bodyId').find('label.oldClass').addClass("newClass");


You can also remove old class and then add new class as follows.

$('#bodyId').find('label.oldClass').removeClass('oldClass').addClass("newClass");



--SDK
 
Share this answer
 
CSS
<script type="text/javascript">
       $(document).ready(function () {
           $('.RegErrMsg').filter(function () {
               var msg = $(this).text();
               if (msg != '') {
                   $(this).removeClass("RegErrMsg");
                   $(this).addClass('tdError');
                   $('.tdRegErrMsg').filter(function () {
                       $(this).removeClass("tdRegErrMsg");
                       $(this).addClass('div');
                   });
               }
               else {
                   $(this).removeClass("tdError");
                   $(this).removeClass('div');
               }
           });
       });
   </script>
   <style type="text/css">
       .div
       {
           border-radius: 8px 8px 8px 8px;
           position: relative;
           background-color: #FFCC00;
           height: 30px;
           width: 400px;
       }
       .tdError
       {
           padding: 15px 10px 15px 50px;
           background-repeat: no-repeat;
           background-position: 10px center;
           color: #FFFFFF;
           background-image: url(../../Images/error.png);
       }

       .tdError:before
       {
           font-weight: bold;
           content: "ERROR : ";
       }
       .RegErrMsg
       {
           font-family: Arial;
           font-size: 12px;
           font-weight: bold;
           color: Black;
           background-color: #FFCC00;
       }
       .tdRegErrMsg
       {
           height: 25px;
           background-color: #FFCC00;
       }
   </style>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900