Hi friends, I have created the no.of div tags in my website applications.
Now i want to change the class name of the tags. How should I?
Below is some code which i want to change:-


                <td style="width:100%;">
                    <div class="roundedcornr_box_203203">
                        <div class="roundedcornr_top_203203"><div></div></div>
                         <div class="roundedcornr_content_203203">
                        <iframe id="Graphframe" name="Graphframe" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"  src="pgeGraph.aspx"></iframe>
                        <div class="roundedcornr_bottom_203203"><div></div></div>

Now i want to change the class name at runtime using javascript
e.g. roundedcornr_box_203203 will be replaced by roundedcornr_box_408625 etc...
I need this very soon.
Thanks in advance

7 Years
Discussion Span
Last Post by vishesh

Get all elements with class name you want either by using getElementBYClass Name or using getAttribute(); and then change its name using setAttribute();. Can guarantee if this will really work well, so try it out.

For changing names in source, replace using Regular Expressions using your text editor.

Edited by happygeek: fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.