Solved

Best way to edit a table in browser

Posted on 2012-03-27
1
146 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now