Hi
I have this code to remove any paragraphs which do not have any content, but it does not work if there is a space in the paragraph.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p:empty").remove();
});
</script>
</head>
<body>
<p class="1">111</p>
<p class="2">2222</p>
<p class="3"></p>
<p class="4"> </p>
</body>
</html>
Paragraph 4 does not get removed... Does anyone know how i can trim any spaces from the beginning of every paragraph then remove the empty ones.
Thanks