I have one dropdown which having type attribute...I want to set value by comparing type and value of element.

```
<select id="selectId">
      <option type="a" value="1">This is a1</option>
      <option type="b" value="1">This is b1</option>
      <option type="b" value="2">This is b2</option>
      <option type="a" value="2">This is a2</option>
</select>

```

in js, I want to set value as

```
$("#selectId").val(1);

```

but this going wrong...how can I compare type also