小编Ed *_*atz的帖子

遍历一个表,按类查找td并更改该td的文本

我有一个实体框架生成的表,其中包含我需要更改的td中的值.我需要逐行执行此操作,因为我需要插入一组单选按钮,但每行按钮都需要一个唯一的名称.

基本上,我需要根据id为"Rate"的td中的文本值设置一组按钮的选中值,并在从中获取值后删除现有文本.

我的表看起来像这样,

<table id="IndexTable">
<tr>
    <th>CoffeeID </th>
    <th>Degree </th>
    <th>Weight </th>
    <th>Profile </th>
    <th>UsageInfo </th>
    <th>Comments </th>
    <th>AmbientTemp </th>
    <th>Rating </th>
    <th>WeightDeducted </th>
    <th>Selected </th>
    <th>ProfileID </th>
    <th>ProfileStart </th>
</tr>
<tr>
    <td>1 </td>
    <td>1 </td>
    <td>3 </td>
    <td>9 </td>
    <td>Filter Brew </td>
    <td>Perfecto!! </td>
    <td>55 </td>
    <td id="Rating">4.25 </td>
    <td>1 </td>
    <td>4 </td>
    <td>34 </td>
    <td>1 </td>

</tr>
<tr>
    <td>3 </td>
    <td>15 </td>
    <td>99 </td>
    <td>87 </td>
    <td>Espresso </td>
    <td>WTF </td>
    <td>99 </td>
    <td id="Rating">4.5 </td>
    <td>5 </td>
    <td>3 …
Run Code Online (Sandbox Code Playgroud)

html jquery html-table entity-framework-4

6
推荐指数
1
解决办法
4万
查看次数

标签 统计

entity-framework-4 ×1

html ×1

html-table ×1

jquery ×1