Jquery obtains tr and changes the tr content sample code.
This article mainly introduces jquery's sample code for getting tr and changing tr content. For more information, see
The Code is as follows:
$ (Document). ready (function (){
$ ("# Email tr"). each (function (){
Var objString = $ (this). children ("# Emailtd"). text ();
If (objString. length> 46 ){
ObjString = $ (this). children ("# Emailtd"). text (objString. substring (0, 46) + "...")
}
});
});
The Code is as follows:
<Pre code_snippet_id = "186521" snippet_file_name = "blog_20140213_2_9981621" name = "code" class = "html"> <tbody id = "Email">
<C: forEach items = "$ {Warns}" var = "Warn">
<Tr> </pre> <pre code_snippet_id = "186521" snippet_file_name = "blog_20140213_3_5314559" name = "code" class = "html"> // you can highlight the topic easily ,... Useless replacement
<Td >$ {...} </Td>
<Td >$ {... } </Td>
<Td >$ {... } </Td>
<Td >$ {...} /> </Td>
<Td >$ {... } </Td>
<Td id = "Emailtd" >$ {Warn. mail} </td>
<Td >$ {... } </Td>
</Tr>
</C: forEach>
</Tbody> </pre> <pre code_snippet_id = "186521" snippet_file_name = "external" name = "code" class = "html"> <pre code_snippet_id = "186521" snippet_file_name = ""blog_201401__3_5314559"> </pre>
<Pre> </pre>
<Pre> </pre>
<Pre> </pre>
<Pre> </pre>
<Pre> </pre>
</Pre>