Sometimes there may be multiple IDs and name values in the include reference to the JSP, and if JS uses that ID or name, an error occurs. In this case, the same code can be separated by the Div, each div is set a special ID, and then the ID value of the name of the div under the tag, so it is unique.
Like what:
<!doctype html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title> test Page </title>
<script type= "Text/javascript" src= "Jquery.js" ></script>
<body>
<table>
<tr>
<TD name= "TD1" >aaa</td>
<TD name= "TD2" >bbb</td>
</tr>
</table>
<table>
<tr>
<TD name= "TD1" >ddd</td>
<TD name= "TD2" >eee</td>
</tr>
</table>
</body>
Can be changed to the following, and through jquery to get the corresponding object
<!doctype html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title> test Page </title>
<script type= "Text/javascript" src= "Jquery.js" ></script>
<body>
<div id= "Div1" >
<table>
<tr>
<TD name= "TD1" >aaa</td>
<TD name= "TD2" >bbb</td>
</tr>
</table>
</div>
<div id= "Div2" >
<table>
<tr>
<TD name= "TD1" >ddd</td>
<TD name= "TD2" >eee</td>
</tr>
</table>
</div>
<script>
$ ("#div1 td[name^= ' TD1 ')". html (); Read
$ ("#div1 td[name^= ' TD1 ')". html (' CCC '); Set up
$ ("#div2 td[name^= ' TD1 ')". html (); Read
$ ("#div2 td[name^= ' TD1 ')". html (' CCC '); Set up
</script>
</body>
This can be separated by the DIV tag, it is also convenient to get the value
The method of obtaining the same name value of the HTML tag