Using jQuery to edit individual table cells

前端 未结 10 1982
心在旅途
心在旅途 2020-12-13 08:14

How can I use jQuery to click on a table cell and edit its contents. There is a particular column which contains several paragraphs of data, so if possible, have a pop up wi

10条回答
  •  遥遥无期
    2020-12-13 08:37

    $("td").click(function(event){
        var myText = '';
        $("myOverlayThing").show();
        $("myOverlayThingCloseLink").click(function(event){
            event.preventDefault();
            myText = $("myOverlayThing.textarea").val();
        });
        $(this).html(myText);
    });
    

    Probably a little more complicated than that, but that's the basic idea without seeing your HTML.

提交回复
热议问题