Click here to Skip to main content
15,908,618 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a table on the body like this` http://prntscr.com/ke6s54
When i double click on any td, it created an input dynamically, and as value getting td's text, like this` http://prntscr.com/ke6tsm

Now when i change input's text and click on any place in body, td's text must be become input's value. How can i do that with change event?

What I have tried:

I don't understand how to use change event
Posted
Updated 9-Aug-18 1:57am

1 solution

Try this:

$("input[type='text']").change(function(){
         $(this).closest('td').text($(this).val())
})
 
Share this answer
 
v2

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