Question: I have a select with options and values:

```
<select id="sid">
<option value="sValue1">sText1</option>
...
</select>

```

I need to create an associated array for all pairs:

```
var data = {"sText1":"sValue1",...};

```

Is there ready/simplifies tools to do that?

Answer: 
It's a basic `for ... on ...` iteration.
Take note that if there are multiple `<option>` with the same label, the last one will take place in the result object.

```js
const select = document.getElementById('sid');
const objContainer = document.getElementById('sid-obj');
const options = select.getElementsByTagName('option');
const selectObj = {};
for (const opt of options) {
    let optObj = {};
    optObj[opt.textContent] = opt.value;
    Object.assign(selectObj, optObj);
}
// print result in code
objContainer.textContent = JSON.stringify(selectObj);
```

```html
<select id="sid">
  <option value="">Default</option>
  <option value="sValue1">sText1</option>
  <option value="sValue2">sText2</option>
  <option value="sValue3">sText3</option>
  <option value="sValue4">sText4</option>
  <option value="sValue5">sText4</option>
</select>

<h2>Result:</h2>
<code id="sid-obj" />
```
Sorry for being late to the party but here is a `jQuery` solution for the same.

```js
var arr = {};
$("#sid option").each(function() {
  let text = $(this).text();
  arr[text] = $(this).val();
});
// print result
$('#sid-obj').append(JSON.stringify(arr));
```

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select id="sid">
  <option value="">Default</option>
  <option value="sValue1">sText1</option>
  <option value="sValue2">sText2</option>
  <option value="sValue3">sText3</option>
  <option value="sValue4">sText4</option>
  <option value="sValue5">sText4</option>
</select>

<h2>Result:</h2>
<code id="sid-obj" />
```