多次重复Div标记。我想在点击按钮后重复id为block_container的div标签?

时间:2017-10-03 09:05:55

标签: javascript java jquery html

enter image description here任何人都可以告诉我如何重复id为block_container的div标签。我是这个UI设计的新手所以我不明白该怎么做。此代码还包含使用struts2

的切片
 <tr>
    <td colspan="4">
        <div class="CustomAttributesBlock GroupBoxBlock">
            <div id="TableWithServerHosts">

                <div class="clearfix">
                    <bean:define id="addFunction">
                        JavaScript:addCustomAttributeSearchForMaintenance('MaintenanceLineItemsAdvancedSearchPageForm', 'MaintenanceLineItemsAdvancedSearch_ADD_MAIN_LINE_ITEM_ATTRIBUTE_SEARCH.do')
                    </bean:define>
                    <h3>
                        <fmt:message key="supportLicenses.AdvancedSearch.FieldLabel.searchMaintenanceLineItemAttributes" />
                    </h3>
                    <a class="CustomAttributesAddDetail Buttons secondary add" href="<%=addFunction%>" id="BAConfigHosts_AddServerHost"> <fmt:message key="supportLicenses.AdvancedSearch.FieldLabel.addSearchAttribute" />
                    </a>
                </div>

                <div id="block_container">

                    <div id="bloc1">
                        <s:select list="%{advSearchBean.metaDataMap}" headerKey="-1" headerValue="" onChange="newFunction(this);"/>
                    </div>

                     <div id="bloc2" style="display">
                        <tiles2:insertTemplate template="/operations/Entitlements/struts2/SearchOperatorTile.jsp" flush="true">
                        <tiles2:putAttribute name="propertyName" type="string" value="advSearchBean.textCustomSearchQualifier"/>
                        </tiles2:insertTemplate>  
                        <s:textfield name="advSearchBean.textCustom" theme="simple" cssClass="form"/>
                    </div>

                    <div id="bloc4" style="display:none;">
                        <s:radio name="advSearchBean.boolCustom" list="#{'true':'Yes', 'false':'No', '':'None'}" theme="simple" cssClass="form" />
                    </div>

                    <div id="bloc5" style="display:none;">
                        <tiles2:insertTemplate template="/operations/Entitlements/struts2/SearchOperatorTile.jsp" flush="true">
                        <tiles2:putAttribute name="formName" value="MaintenanceLineItemsAdvancedSearchPageForm"/>
                        <tiles2:putAttribute name="propertyName" type="string" value="advSearchBean.numCustomSearchQualifier"/>
                        <tiles2:putAttribute name="propertyType" value="numeric"/>
                        </tiles2:insertTemplate>
                        <s:textfield name="advSearchBean.numCustom" theme="simple" cssClass="form"/>
                    </div>

                    <div id="bloc3" style="display:none;">
                        <tiles2:insertTemplate template="/operations/Entitlements/struts2/SearchOperatorTile.jsp">
                            <tiles2:putAttribute name="formName" value="MaintenanceLineItemsAdvancedSearchPageForm"/>
                            <tiles2:putAttribute name="propertyName" value="advSearchBean.dateCustomSearchQualifier"/>
                            <tiles2:putAttribute name="propertyType" value="date"/>
                        </tiles2:insertTemplate>
                        <tiles2:insertTemplate template="/operations/common/struts2/simpleDateTile.jsp" flush="true">
                            <tiles2:putAttribute name="formName" type="string" value="MaintenanceLineItemsAdvancedSearchPageForm" />
                            <tiles2:putAttribute name="propertyName" type="string" value="advSearchBean.dateCustom" />
                            <tiles2:putAttribute name="buttonId" type="string" value="dateButton" />
                            <tiles2:putAttribute name="isRequired" type="string" value="true" />
                            <tiles2:putAttribute name="generateTd" type="string" value="false" />
                        </tiles2:insertTemplate>
                    </div>

                </div>
            </div>
        </div>
    </td>
</tr> 

0 个答案:

没有答案