数据表占位符不允许fa图标

时间:2018-01-18 15:03:04

标签: javascript jquery html icons

我使用此代码设置标准数据表表

  <table id="example" class="table dt-responsive nowrap" cellspacing="0" width="100%">
                <thead>
                <tr>
                  <th></th>
                  <th>Name</th>
                  <th>UserGroup</th>
                  <th>Join Date</th>
                  <th>Action</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                <td>1</td>
                <td>2</td>
                <td>3</td>
                <td>4</td>
                <td>5</td>
                </tr>
                </tbody>
                </table>

现在一切正常,它显示正常,但是当我使用javascript初始化我的数据表时,我似乎无法获得占位符的HTML以显示搜索过滤器

<script>

    $(document).ready(function () {

        $('#example').DataTable({
            "processing": true,
            "info": true,
            "stateSave": true,
            "dom":' <"search"f><"top"l>rt<"bottom"p><"clear">',
                language: {
        search: "_INPUT_"
    },


        });
                $('div.dataTables_filter input').attr('placeholder', '<i class="fa fa-search"></i>Search...');


    });
</script>

这一切都有效,但搜索过滤器的占位符是一个图标,并说搜索...它只是显示html而不是将其渲染为实际图标?

感谢。

0 个答案:

没有答案