两个具有相同Id和Name的HTML输入动态解决

时间:2015-01-13 13:06:08

标签: html jscript

正如你所看到的,我希望有两个或更多输入samo Id和Name,但是HTML不允许这样做,所以如何通过其他方式解决这个问题以及如何让主动按钮改变它的颜色

<table border="0" cellspacing="0" cellpadding = "0" style="font-size:x-small">        
            <tr valign="bottom" style="height:10px">
               <td width="30px" style="vertical-align: top">
                </td>
                <td width="30px" style="vertical-align: middle" align="center" nowrap="nowrap">
                    <label style="font-size:small">
                        Time period</label>

                    <input type="hidden" id="ReportParameter" value = "1" name="ReportParameter" />       
                    <input class="button" id="showDailyReport" name="searchQueue" type="submit" value="Day" onClick="onClickHandler(this)" />

                    <input type="hidden" id="ReportParameter" value = "2" name="ReportParameter"/>       
                    <input class="button" id="showWeeklyReport" name="searchQueue" type="submit" value="Week" onClick="onClickHandler(this)" />

                </td>
            </tr>

        </table>

1 个答案:

答案 0 :(得分:0)

您可以为每个按钮定义特定的类,并对该类进行可视化更改 前

<input class="button button-red" id="showDailyReport" name="searchQueue" type="submit" value="Day" onClick="onClickHandler(this)" />