H5W3
当前位置:H5W3 > 其他技术问题 > 正文

【Web前端问题】jquery获取元素内的内容获取不到

clipboard.png

clipboard.png

clipboard.png

怎么都获取不到发那个字获取到的是一个input

<div class="main-content"  style="margin-left:0;padding-left:0; ">
    <!--body wrapper start-->
    <div class="wrapper">
        <div class="row">
            <div class="col-sm-12">
                <section class="panel">
                    <header class="panel-heading">
                        Editable Table
                        <span class="tools pull-right">
                    <a href="javascript:;" class="fa fa-chevron-down"></a>
                    <a href="javascript:;" class="fa fa-times"></a>
                 </span>
                    </header>
                    <div class="panel-body">
                        <div class="adv-table editable-table ">
                            <div class="clearfix">
                                <div class="btn-group">
                                    <button id="editable-sample_new" class="btn btn-primary">
                                        Add New <i class="fa fa-plus"></i>
                                    </button>
                                </div>
                                <div class="btn-group pull-right">
                                    <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Tools <i class="fa fa-angle-down"></i>
                                    </button>
                                    <ul class="dropdown-menu pull-right">
                                        <li><a href="#">Print</a></li>
                                        <li><a href="#">Save as PDF</a></li>
                                        <li><a href="#">Export to Excel</a></li>
                                    </ul>
                                </div>
                            </div>
                            <div class="space15"></div>
                            <table class="table table-striped table-hover table-bordered" id="editable-sample">
                                <thead>
                                <tr>
                                    <th>rid</th>
                                    <th>status</th>
                                    <th>Edit</th>
                                    <th>Delete</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $data as $item}
                                <tr class="">
                                    <td>{$item['rid']}</td>
                                    <td class="center">{$item['status']}</td>
                                    <td><a class="edit" href="javascript:;">Edit</a></td>
                                    <td><a class="delete" href="javascript:;">Delete</a></td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
    <!--body wrapper end-->
</div>

回答:

val()呢?

回答:

你在jq跟原生的混用
var nRow=$(this).parents(“tr”).eq(0)
var pre=nRow.children().eq(1)
pre.html()

本文地址:H5W3 » 【Web前端问题】jquery获取元素内的内容获取不到

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址