Home >Web Front-end >JS Tutorial >jquery gets tr and changes tr content sample code_jquery

jquery gets tr and changes tr content sample code_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:00:031117browse
Copy code 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) "...")
}
});
});

Copy code The code is as follows:

 <tbody id="Email"> <br><c:forEach items="${Warns }" var="Warn"&gt ; <BR><tr >
//In order to look simple and highlight the theme,. . . Replaces the useless <br><td>${. . . }</td> <br><td>${. . . }</td> <br><td>${. . . }</td> <br><td>${. . . }/></td> <br><td>${. . . }</td> <br><td id="Emailtd">${Warn.mail }</td> <br><td>${. . . }</td> <br></tr> <br></c:forEach> <br></tbody>
<pre code_snippet_id="186521" snippet_file_name="blog_20140213_3_5314559">
<br><pre class="brush:php;toolbar:false">
<br><pre class="brush:php;toolbar:false"> <br><pre class="brush:php;toolbar:false"> <br><pre class="brush:php;toolbar:false">

Statement:
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