> 웹 프론트엔드 > JS 튜토리얼 > tr 및 td content_jquery를 작동하기 위한 JQuery 메서드 예제

tr 및 td content_jquery를 작동하기 위한 JQuery 메서드 예제

WBOY
풀어 주다: 2016-05-16 17:40:58
원래의
1152명이 탐색했습니다.
코드 복사 코드는 다음과 같습니다.

<html xmlns="http://www.w3.org/1999/xhtml"><br><head id=" Head1" runat="server"><br>    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><br>    <link href="../ esstec_css/style.css" type="text/css" rel="stylesheet" media="all" /><br>    <link href="../esstec_css/style.nk.css" rel="stylesheet " type="text/css" /><br>    <script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script><br>    <link href="../esstec_css/Default.css" rel="stylesheet" type="text/css" /><br>    <link href="../esstec_css/BMS-Form. css" rel="stylesheet" type="text/css" /><br>    <script type="text/javascript"><br>        $(document).ready(function () {<br>            $ ("#selEmployee").click(function () {<br>                var $table = $("#tbProEmployee tr");<br>               var len = $table.length;<br>               var trid = "tbProEmpl 응" 렌 ;<br>               var strDeviceTr = "<tr id=" trid ">";<br>                strDeviceTr = "<td ><input id="txtEmployeeInnerID" type="hidden" name="ProjectEmployee" 값 ="" "123" "" /><input id="txtInnerID" type="hidden" name="ProjectEmployee" value="" />";<br>               strDeviceTr = "<label id=" txtEmployeeName">" "이름" "</label></td>";<br>               strDeviceTr = "<td><input id="txtRemark" type="text" name="ProjectEmployee" / ></td>";<br>                strDeviceTr = "<td ><a href="javascript:;SaveProEmployee('" trid "')">保存</a> | <a href="javascript:;DelProEmployee('" trid "')">删除</a></td>";<br>               strDeviceTr = " </tr>";<br>                $ ("#tbProEmployee").append(strDeviceTr);<br>            });<br>        });<br>        function SaveProEmployee(index) {<br>           //ajax保存<br>            var tr = $("tr [id=" index "]");<br>            var 직원 = tr.find("#txtEmployeeName").text();<br>            var comment = tr.find("#txtRemark").val(); <br>            var strtd = "<td><input id="txtEmployeeInnerID" type="hidden" name="ProjectEmployee" value="" "123" "" /><input id="txtInnerID" 유형 ="hidden" name="ProjectEmployee" value="" />";<br>            strtd = "<label id="txtEmployeeName">" 직원 "</label></td>";<br>            strtd = "<td ><label id="txtRemark">" 발언 "</label></td>";<br>            strtd = "<td ><a href ="javascript:;UpdateProEmployee('" index "')">修改</a> | <a href="javascript:;DelProEmployee('" index "')">删除</a></td>";<br>            tr.html(strtd);<br>        }<br>        function UpdateProEmployee(index) {<br>            //ajax保存<br>            var tr = $("tr[id=" + index + "]");<br>            var employee = tr.find("#txtEmployeeName").text();<br>            var remark = tr.find("#txtRemark").text();<br>            var strtd = "<td><input id=\"txtEmployeeInnerID\" type=\"hidden\" name=\"ProjectEmployee\" value=\"" + "123" + "\" /><input id=\"txtInnerID\" type=\"hidden\" name=\"ProjectEmployee\" value=\"\" />";<br>            strtd += "<label id=\"txtEmployeeName\">" + employee + "</label></td>";<br>            strtd += "<td><input id=\"txtRemark\" type=\"text\" name=\"ProjectEmployee\" value=\"" + remark + "\" /></td>";<br>            strtd += "<td ><a href=\"javascript:;SaveProEmployee('" + index + "')\">保存</a> | <a href=\"javascript:;DelProEmployee('" + index + "')\">删除</a></td>";<br>            tr.html(strtd);<br>        }<br>        function DelProEmployee(index) {<br>            if (confirm("Are you sure?")) {<br>                $("tr[id=" + index + "]").remove();<br>            }<br>        }<br>    </script><br></head><br><body><br>    <form id="form1" runat="server"><br>    <div class="snippet download-list"><br>        <table class="telerik-reTable-2" id="tbProEmployee"><br>            <tbody><br>                <tr><br>                    <th colspan="3"><br>                        [<a id="selEmployee" href="javascript:void(0)">执行人员</a>]<br>                    </th><br>                </tr><br>                <tr><br>                    <th><br>                        姓名<br>                    </th><br>                    <th><br>                        备注<br>                    </th><br>                    <th><br>                        操作<br>                    </th><br>                </tr><br>            </tbody><br>        </table><br>    </div><br>    </form><br></body><br></html>




< /PRE><br><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">
로그인 후 복사

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
최신 이슈
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿