Question: Basically in my ASP.NET MVC4 project I'm trying to have my validationmessages as tooltips (which gets displayed when hovered over a certain image).
Right now the error message is inserted into the image title - however I'd like to ONLY display the image when it has a title (when it doesn't have a title there is no error message).

How can I do this?

I don't suppose it is possible through CSS so a js/jquery solution would work too.

To clarify I need to check update the display as the title changes during runtime.
An initial check is not gonna do it.

Answer: 
Here is the pure CSS solution.

**The CSS Code:**

```
img{display:none;}
img[title]{display:block;}

```

Here is a **[WORKING DEMO](http://jsfiddle.net/KdUru/)**

**The HTML:**

```
<img src="https://www.google.co.in/images/srpr/logo4w.png" />
<img src="https://www.google.co.in/images/srpr/logo4w.png" />
<img src="https://www.google.co.in/images/srpr/logo4w.png" title="" />
<img src="https://www.google.co.in/images/srpr/logo4w.png" />
<img src="https://www.google.co.in/images/srpr/logo4w.png" />

```

**The CSS:**

```
img{display:none;}
img[title]{display:block;}

```

Hope this is what you are looking for.
Only display images with a title?

```
$('img').filter(function(i, el){
    return !$(el).prop('title');
    // (empty/undefined titles evaluates as false)
}).hide();

```

Is this what you're asking for?

Perhaps this css selector is enough (will only work in modern browsers):

```
img:not([title])
{
    display: none;
}

```