When you click Edit, get the content implementation method for editing sibling tags:
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<body>
<table>
<thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<TD onclick= "Get_prev (this);" > Edit </td>
</tr>
</tbody>
</thead>
</table>
<script src= "Jquery-3.1.0.min.js" type= "Text/javascript" ></script>
<script type= "Text/javascript" >
function Get_prev (ARG) {
$ (ARG). Siblings (), which denotes all brother tags
Map loops through each label in multiple tags,
Each tag is looped to execute a function inside the map and get its return value (first return value 1, second 2, third 3)
Encapsulates all the return values into an array (list),
Last return list
var list = $ (ARG). Siblings (). Map (function () {
Labels for the current loop
return $ (this). text ();
});
Console.log (list[0],list[1],list[2]);
}
</script>
</body>
This article from "Flat Light is true" blog, please be sure to keep this source http://ucode.blog.51cto.com/10837891/1850649
jquery Operation Example