जावास्क्रिप्ट में सेल का innerHTML प्राप्त करने के लिए innerHTML प्रॉपर्टी का उपयोग करें। जावास्क्रिप्ट में सेल का innerHTML प्राप्त करने के लिए निम्नलिखित कोड चलाएं:
उदाहरण
<!DOCTYPE html> <html> <head> <script> function cellFunc(x) { var cell = document.getElementById(x).rows[0].cells; document.write(cell[0].innerHTML); } </script> </head> <body> <table style="border:2px solid black" id="newtable"> <tr> <td>One</td> <td>Two</td> </tr> <tr> <td>Three</td> <td>Four</td> </tr> <tr> <td>Five</td> <td>Six</td> </tr> </table> <p> <input type="button" onclick="cellFunc('newtable')" value="Display Table Cell"> </p> </body> </html>