The example in this article describes the method of obtaining the td value in Table using JS. Share it with everyone for your reference. The details are as follows:
1. When you want to obtain any TD in multiple rows, set a common class for each TD
a34de1251f0d9fe1e645927f19a896e8
49e41c4e0f0c2685bacc9bb690cd0e12002b90dd5946f0946207856a8a37f441edf
0d1ff12954cb6170a479f6dbcd3b0121Ailiu APP Internet Promotionb90dd5946f0946207856a8a37f441edf
87f8e5b8deca0197038a5ea23de74db1Group Marketing Departmentb90dd5946f0946207856a8a37f441edf
87f8e5b8deca0197038a5ea23de74db12015-3-16b90dd5946f0946207856a8a37f441edf
87f8e5b8deca0197038a5ea23de74db12015-3-25b90dd5946f0946207856a8a37f441edf
227e9c0d750efc4936d167a1b8f62dad11b90dd5946f0946207856a8a37f441edf
b6c5a531a458a2e790c1fd6421739d1cb90dd5946f0946207856a8a37f441edf
fd273fcf5bcad3dfdad3c41bd81ad3e5
In the initialization method:
$(document).ready(function() {
$(".mouse_hover").click(function() {
//$(this).context.innerHTML //同样效果
alert($(this).text());
//alert("222" + $(this).context.innerText);
})
});
2. Fixed the TD value and set the TD id:
document.getElementById('td1').innerHTML
I hope this article will be helpful to everyone’s JavaScript programming design.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn