首页 > 代码库 > 获取文本内容

获取文本内容

方法一:
<td class="p-t-sm">
<a th:href="http://www.mamicode.com/@{/home/footer/item/{footerNavId}(footerNavId=${footerNav.id})}"
class="text-muted"><p th:text="${footerNav.name}">关于中小型企业服务平台</p></a>
<input type="hidden" name="_csrf" th:value="http://www.mamicode.com/${_csrf.token}">
<input type="hidden" id="footerNavDeleteName">
</td>
<div class="modal-body">
<p class="text-muted p-v-xl" id="showText">您确定要删除<span>该二级菜单</span>?删除后将不可恢复。</p>
</div>


function addFooterNavDeleteEvent() {
$(".deleteFooterNavBtn").unbind(‘click‘).click(function () {
footerNavId = $(this).data("id");
footerNavName = $(this).data("name");
$("#showText span").text("");
$("#footerNavDeleteModal #footerNavDeleteName").val(footerNavName);
$("#showText span").append(footerNavName);
$("#footerNavDeleteModal").modal(‘show‘);
});
}


方法二:
<tr th:each="subServiceType,row : ${serviceType.subServiceTypes}">
<td class="p-t-sm">
<a th:href="http://www.mamicode.com/@{/services/manage?subServiceTypeId={subServiceTypeId}(subServiceTypeId=${subServiceType.id})}"
class="text-muted">
<p th:text="${subServiceType.name}">商贸公司注册</p>
</a>
</td>
<td>
<button class="btn btn-link sub-service-edit" type="button"
th:attr="data-id=${subServiceType.id}">
<i class="fa fa-pencil text-muted text-md"></i>
</button>
<button class="btn btn-link sub-service-delete" type="button"
th:attr="data-id=${subServiceType.id}">
<i class="fa fa-trash text-muted text-md"></i>
</button>
</td>
</tr>

<div class="modal-body">
<p class="text-muted p-v-xl" id="deleteCompany">您确定要删除“<span>商贸公司注册</span>”服务?删除后将不可恢复。</p>
</div>
function addSubServiceDeleteEvent() {
$(‘.sub-service-delete‘).unbind(‘click‘).click(function () {
subServiceIdDelete = $(this).data(‘id‘);
var companyName = $(this).parents(‘tr‘).find(‘p‘).text();
$(‘#deleteCompany span‘).text(companyName);
$(‘#deleteMenu‘).modal();
});
}


获取文本内容