0

the textarea updates correctly but no longer after manual modification !!

$(document).ready(function() {
  $('tbody').on("click", "td", function(a) {
    $("textarea").text($(this).text());
  });
});
<textarea rows='5' cols='33'></textarea>
<table>
  <tbody>
    <tr>
      <td>Bulgarie</td>
    </tr>
    <tr>
      <td>Cambodge</td>
    </tr>
    <tr>
      <td>Canada</td>
    </tr>
    <tr>
      <td>CMC Chili</td>
    </tr>
    <tr>
      <td>Chine</td>
    </tr>
  </tbody>
</table>

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339

0 Answers0