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
$(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.