Question: I want to add some text inside a div if that div matches condition. Right now all the div's are filled up with the added text. Please check my code to better understand what I mean. 
What's the best solution to achieve my goal? Thank you.

```js
$('.col-md-3').each(function () {
    if ($('.status:contains("Rent")').length > 0) {
        $('.price').append('/month');
    };
    return false;
});
```

```html
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<div class="row">
  <div class="col-md-3"><div class="status">Rent</div><div class="price">€100</div> 
  </div>
  <div class="col-md-3"><div class="status">Rent</div><div class="price">€100</div>
  </div>
  <div class="col-md-3"><div class="status">For sale</div><div class="price">€1000</div>
  </div>
  <div class="col-md-3"><div class="status">For sale</div><div class="price">€1000</div>
</div>
```

Answer: 
I'd suggest, for the posted code:

```js
// select all <img> elements:
$('img')
  // select all sibling elements of
  // the <img> elements that match the
  // supplied ('br') selector:
  .siblings('br')
  // remove those found siblings:
  .remove();
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p>
  some text
  <br>more text
</p>
<br>
<img src="image.jpg" alt="image">
<br>
<br>
<img src="image2.jpg" alt="image">
<br>
<img src="image3.jpg" alt="image">
<br>
```

For slightly more complex cases (as well as this one), though, the following may be preferred:

```js
// select all <img> elements:
$('img')
  // get all subsequent siblings until an element
  // is found which matches the supplied selector
  // (':not(br)'), in this case the selector matches
  // any element that is not a <br> element:
  .nextUntil(':not(br)')
  // we remove those elements that are found
  // which must be <br> elements, given the
  // above selector:
  .remove();
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
some text
<br>more text
<br>
<img src="image.jpg" alt="image">
<br>
<br>
<img src="image2.jpg" alt="image">
<br>
<img src="image3.jpg" alt="image">
<br>
```

References:

* CSS:
	+ [`:not()`, CSS Negation pseudo-class](https://www.w3.org/TR/css3-selectors/#negation).
* jQuery:
	+ [`nextUntil()`](http://api.jquery.com/nextUntil/).
	+ [`siblings()`](http://api.jquery.com/siblings/).
```
$('img + br').remove(); try this

```