Home > DeveloperSection > Forums > How To Change The Text Of The Td Using Jquery.?
ben reitman
ben reitman

Total Post:96

Points:676
Posted on    October-20-2014 11:58 PM

 JQuery JQuery  JavaScript 
Ratings:


 1 Reply(s)
 562  View(s)
Rate this:
I have the td with a dropdown . I want to replace the "Activity class" text by "some other name" . please help me.

<td align="left" class="ItemLabel" classname="ItemLabel" style="width: 50%;">Activity class<br><select class="inputFieldClass" classname="inputFieldClass" id="QA_0-1-71" name="QA_0-1-71"><option value="">&lt;None&gt;</option><option value="15105">First Time Contact</option><option value="15106">Follow up</option></select></td>


jacob rasel
jacob rasel

Total Post:88

Points:616
Posted on    October-20-2014 11:59 PM

Hi ,

 You can do like this.

<table id="demoTable">

                <tr>

                    <td align="left" class="ItemLabel"classname="ItemLabel" style="width50%;">Activity class<br>

                        <select class="inputFieldClass"classname="inputFieldClass" id="QA_0-1-71" name="QA_0-1-71">

                            <option value="">&lt;None&gt;</option>

                            <option value="15105">First Time Contact</option>

                            <option value="15106">Follow up</option>

                        </select></td>

                </tr>

            </table>

and add script on header

<script type="text/javascript">

        $(document).ready(function () {

          

            $("#demoTable td").each(function () {

                var t=$(this).html();

                $(this).html(t.replace('Activity class''some other name'));              

            });

        });

    </script>


Modified On Mar-15-2016 05:52:07 AM

Don't want to miss updates? Please click the below button!

Follow MindStick