Solved

Best way to edit a table in browser

Posted on 2012-03-27
1
153 Views
Last Modified: 2012-04-18
I'm trying to have an HTML table that someone can click a <td> tag, type, and have whatever they type show up in that tag.

What would be the best way to do this?
Thanks,
-JWW


<table>
<tbody>
      <tr>
            <td>A</td>
            <td class="edit">B</td>
      </tr>
      <tr>
            <td>C</td>
            <td class="edit">C</td>
      </tr>

</tbody>
</table>

Open in new window

0
Comment
Question by:JustinW
1 Comment
 
LVL 6

Accepted Solution

by:
bartvd earned 500 total points
ID: 37773576
<html>
<head>
<script type="text/javascript">
function displaymessage(element)
{
var reply=prompt("Enter a value:","");
element.innerHTML=reply;
}
</script>
</head>

<body>
<table>
<tbody>
      <tr>
            <td onclick="displaymessage(this)">A</td>
            <td onclick="displaymessage(this)">B</td>
      </tr>
      <tr>
            <td onclick="displaymessage(this)">C</td>
            <td onclick="displaymessage(this)">D</td>
      </tr>

</tbody>
</table>
</body>
</html>
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generate Numbers in JQuery file 11 66
Not allowed to load local recource. 4 34
Javascript 2 20
On Load function does not trigger on iPhone 4 32
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question