Jump to content

problem with text() method


mostafatalebi

Recommended Posts

hello everybody

 

I have problem with following script:

 

(I want to add text when I click on the link, but it does not work. When I do with append() method, however it works

<script type='text/javascript'>
            var fontSize = 15;
            $(document).ready(function(e) {
                 $("#links_holder h21 a").click(function () {
                    $(this).parent().parent().text("Added!");    
                });
            });
</script>
</head>
<body>

<div class="nothing" id="links_holder">
<h1><a href="#">Click Here to Add Content!</a></h1>
                        <table id="exampleTable">
                            <tr><th>Name</th><th>Occupation</th></tr>
                        </table>
                        </div>
                        
                        <div style="margin-top: 400px;" id="far_div">
                        
                        </div>
</body>
 

 

Link to comment
https://forums.phpfreaks.com/topic/276379-problem-with-text-method/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.