jquery table replace partial table content inside html -


i have table:

html

<div class="bbclass1 bbclass2">     <table>         <tr>             <td><b>name:</b> value1</td>             <td>value2</td>             <td>value3</td>             <td>value4</td>         </tr>     </table> <div> 

i need replace 'name:' to 'hello:'

how do this?

i have tried

$("td :contains('name:')").text("hello:");  

for reason replaces entire table name1.

this not work either:

$("div:contains('name:')").html("hello"); 

any other suggestions?

you using wrong selector.

there should no space between

`"td :contains"`     ^------- remove space 

supposed

$("td:contains('name:')").text("hello:");  

you can try

$("td b:contains('name:')").text("hello:");  

check fiddle


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -