我有一个div
其中包含一个td class='small'
我想用jQuery来删除它。使用jquery删除td类
<td class="small" style="padding:8px 0;color:#999;vertical-align:middle;">
A bunch of gibberish...
</td>
在我主要的代码,我使用jQuery来提取一个文件一个div然后替换div
与提取的主代码。
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="content-language" content="en">
<meta name="viewport" content="width=500" />
<title>Rooster Teeth News</title>
<link rel="stylesheet" type="text/css" href="site/wwwRand1.css">
<?php
include('site/simple_html_dom.php');
$html=file_get_html('http://roosterteeth.com/home.php');
$html->save('site/result.htm')
?>
<script type="text/javascript" src="site/jquery.js"></script>
<script type="text/javascript">
$('document').ready(function() {
$('#postsArea').load('site/result.htm #postsArea');
});
</script>
</head>
<body>
<div id="wrap">
<div id="postsArea"></div>
</div>
我遇到的问题是我只能在'div'被替换后删除'td'。如果有人可以帮助我,我会非常感激。谢谢。
$( 'td.small')removeClass( '小'); –
如果元素是新的ajax内容的一部分,则需要使用'load()'的回调...请参阅文档 – charlietfl
感谢您的帮助 – Sabre