Present Simple 



The simple present or present simple is one of the present tenses used in modern English, the others being Present continuous (English) and the emphatic present. The simple present is mainly used to express habitual actions, such as he walks to school. The simple present is often employed in newspaper headlines, conditional sentences, when a planned event is described along with a time in the future, in suggestions beginning with Why don't you.?, and with certain verbs. Present Simple The Present Simple tense is the most basic tense in English and uses the base form of the verb (except for the verb be). The only change from the base is the addition of s for third person singular. How do we make the Present Simple tense?

Past Simple

If you have an empty div or other element that you want it removed if does not contain any html tags or text inside it, here is a quick guide how to do it with jQuery. I will also show you how to handle empty tags using CSS only. Make sure to watch the video tutorial if you want to see live examples.

To give you a fast example of what we are going to do, let's pretend that you have a <div> and inside it there will be a text added by user. If the user will not add anything in that tag, your style will still remain on that div container and you want it removed if it doesn't contain any html tags or text.

The Present Simple Tense in English. Use the Present Simple tense (“I go”, “He goes” etc) to talk about facts, things that are always true, or for routines and habits. For example: In England it often snows in winter. (a fact) I live in London (true – I don’t change my house every day). With all other verbs, we make the present simple in the same way. The positive is really easy. It's just the verb with an extra 's' if the subject is 'he', 'she', or 'it'. Let's take the verb 'play' as an example. The simple present (also called present simple or present indefinite) is a verb tense which is used to show repetition, habit or generalization. Less commonly, the simple present can be used to talk about scheduled actions in the near future and, in some cases, actions happening now.

Full HD Video Tutorial

Check for Empty Tag Elements with CSS

The easiest method to hide or remove an empty tag is by using the CSS3 selector :empty directly on the element you want. You can read more about this selector here.

The problem with the :empty selector is that he is only targeting just empty elements, without white space. If you have, for example, a space there or a simple &nbsp;, your CSS code will not work. To solve that we will use jQuery.

Check if Div is Empty (if HTML Element has Text) with jQuery

With jQuery you can check the length of the text inside the div or element you are targeting to see how many characters it has. There are 2 ways to do that. One with text() function and the other one with html() function.

Present

Checking Text Length of Element with text() function

Using the text() function to check the length, it will count only the characters inside the element. If you have another empty tag inside it, you must use the html() function.

Get Text Length together with the Tags of Elements inside with html() function

Present simple and present continuous

To check if div is empty (or any html element) together with the tags elements inside it, use html() function. If you use just text, it will work the same as the function above, the difference is this one is counting the length in tags also.

Check If Element has Any Children Tags Inside

If you have a custom structure where you know the user can add only a text which is always inside another tag, you can search if a div or another element contains any children tags inside it.

Check for Empty Elements with White-space

If an element contains just a space, without text, it will not be considered an empty element because has something inside it. Here is how you check if the div is empty even with blank spaces (white-space) or entities such as &nbsp; (non-breaking space) using $.trim function from jQuery.

Update (11 April 2015)

Present simple passive

To check if div is empty (or if every <p> in your document is empty) and remove the white-space inside it with the condition to not contain any html tag inside it you must to write 2 if conditions and then replace the content using text() or html() functions. Below is the code. You can uncomment the second line inside the last if statement, to remove all paragraphs which contains white-space (&nbsp;).

Check If a Certain Tag Exists inside a Container

If you have an already built html structure which is generated automatically and you want an easy way to check if inside a div there is a tag, here is how you do it. For example you want to check for <h1> tag if exists. To do that just point the jQuery selector on <h1> and check the length of it.

Perfect

End Notes

Present

Present Perfect

All the code above is a handy method to work with elements if you don't really have too much access in the html structure. You can add a class to body tag to handle everything very simple. If you have any questions or improvements, drop them below in the comments section.