Click here to Skip to main content
14,984,032 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have html table, value are added to the table at run time,
I want to edit the value in row, if click the row its change to textbox, I need solutions?
Updated 5-Dec-17 1:12am


You can do that using jQuery very easily,

Here[^] you can find solution.

Sample Code,
$("#table_ID td:contains('youSearchText')").html('YourTextToReplace');

Let me know if you have any other query,

-Amit Gajjar
Skvignesh 14-Aug-12 4:23am
i ve to do it in javascript ly, that's y i'm asking...
AmitGajjar 14-Aug-12 4:27am
jQuery is javascript API. and it's MIT license so you can use it.
AmitGajjar 14-Aug-12 4:29am
Please check my updated answer.
How about this pure javascript
	<script type="text/javascript">
		function Change() {
			var txt = parseInt(document.getElementById("txt").value)
			var tr = document.getElementById("tbl").getElementsByTagName("tr")
			tr[txt].getElementsByTagName("td")[0].innerHTML = "change me"
		<table id="tbl">
		<input type="text" id="txt"/>
		<input type="button" id="btn" value="Change" onclick="Change();"/>

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