Home > Web Front-end > JS Tutorial > body text

JS method to obtain td value in Table_javascript skills

WBOY
Release: 2016-05-16 16:08:29
Original
1449 people have browsed it

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

Copy code The code is as follows:

002
Ailiu APP Internet Promotion
Group Marketing Department
2015-3-16
2015-3-25
11


In the initialization method:
$(document).ready(function() {
 $(".mouse_hover").click(function() {
    //$(this).context.innerHTML //同样效果
    alert($(this).text());
    //alert("222" + $(this).context.innerText);
  })
});
Copy after login

2. Fixed the TD value and set the TD id:

document.getElementById('td1').innerHTML
Copy after login

I hope this article will be helpful to everyone’s JavaScript programming design.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!