zoukankan      html  css  js  c++  java
  • 在th中显示图片

    从DataTable中获取值:

      foreach (DataRow dr in ((DataTable)ViewBag.bookInfoList).Rows)
                {
    
            <tr>
    <th class="showImg" value="@dr["example"]"></th>
                <th class="showImg">"@dr["answer"]"</th>
                <th  class="showImg" value="@dr["analysis"]"></th>
                <th>@dr["keypoint"]</th>
                <th>@dr["keypointTitle"]</th>
                <th  class="showImg" value="@dr["keypointContent"]"></th>
                <th  class="showImg" value="@dr["examples"]"></th>
    }
    

     循环显示:

     $(function () {
            $('.showImg').each(function (item, index) {
                console.log($(this));
                console.log(index);
                $('.showImg').eq(item).html($('.showImg').eq(item).attr('value'));
            })
        });
    
  • 相关阅读:
    「2019纪中集训Day20」解题报告
    PHP基础入门
    javascript
    正则表达式
    DOM 节点
    对象
    字符串
    函数
    for循环
    jQuery
  • 原文地址:https://www.cnblogs.com/sunliyuan/p/8891426.html
Copyright © 2011-2022 走看看