I want load html code with jQuery and delete from this code some classes, my code is:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div id="new-nav"></div>
<script>
$("#new-nav").load("/php/grab.php");
</script>
<script>
$('.main_title_news_submain_block').remove();
</script>
</body>
</html>
is problem that .remove function not working, I dont know why ?
You need to perform the
.remove()after the content is loaded using the callback function.Edit:
You might also wrap everything in a document ready to ensure the load is occurring after the element with the id new-nav is loaded in the dom.