I am searching for a while now with no results so I decided to ask you guys. :)

I have some Bootstrap-inputs like:

```
<input class='form-control' id='start_name' />
<input class='form-control' id='end_name' />

```

Normaly I would select data like

```
var myValue = $('#start_name').val();

```

The Problem I have is, I want to select an element containing a specified string that gets set before like:

```
$('#start_name').val('foobar');

```

Obviously `.val()` not sets the value of the inputfield. I have to extra add a line like

```
$('#start_name').attr('value', 'foobar');

```

or combine it like

```
$('#start_name').val('foobar').attr('value', 'foobar');

```

The actuall code I want to use to select the relevant element and empty it is:

```
$("input[value='" + theSpecifiedValue + "']").val('');

```

(select Input from X inputs that contains the string)

But since I use bootstrap I have to explicit have to set the value with `.attr()`

Is there some im missing or is this the only way to do it ?

**[Here is a Fiddle](https://jsfiddle.net/Dwza/eqnvs88u/)**