English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Simple Example of Using jQuery to Get the Value of Custom Tag Attributes

As shown below:

<tr class="gradeX" role="row" id="1001>
<td>Wang Xizhi</td>
<td>2016-01-06</td>
<td name="phone" style="display:none;">13680130700</td>
<td name="pwd" style="display:none;">123456</td>
<td class="td-text-center">
<a class="btn btn-sm green" href="#itemSettingAccount" onclick="setingInit('1001')" data-toggle="modal">Set Principal</a>
</td>
</tr>
//Custom attributes can also find the value
var phone = $("#" + itemId).find("td[name=phone]").html();//Account
var pwd = $("#" + itemId).find("td[name=pwd]").html();  //Password

This article on how to retrieve the value of a custom attribute using jQuery is all the editor has shared with everyone. It is hoped that it can provide a reference for everyone, and everyone is also expected to support and cheer for the tutorial.

You May Also Like