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

Esempio semplice di ottenere il valore dell'attributo personalizzato del tag utilizzando jQuery

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

The simple example of using jQuery to get the value of a custom tag attribute mentioned above is all the content I share with you. I hope it can serve as a reference for you, and I also hope that everyone will support and cheer for the tutorial.

Ti potrebbe interessare