Question: How can I combine this two selectors:

```
$("td.listas select:last option:selected")

```

This doesn't work!

What I'm trying to achieve is:

* Get the **select** input from a **td** with the class **listas**
* Get the **option** that is **selected**

**Notes:**

* In this **td**, I have two **select** inputs.

**Code working:**

```
    var selectprimeiro = $('td.listas select:first');
    var selectsegundo = $('td.listas select:last option');
    selectsegundo.prop("selected",true);
    var selected = $("td.listas select:last option:selected");
    selected.each(function(){
        selectprimeiro.append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option>");
        selected.remove();
    });

```

Answer: 
I think you want

```
var lastSelectedOptionElement = $("td.listas select option:selected").last();

```

First you get all of the selected options, then you take the last of them. [Gratuitous live example](http://jsbin.com/uharot) | [source](http://jsbin.com/uharot/edit)

You might be tempted to do `option:last:selected`, but that won't work (unless the last option in the list happens to be selected), because the `option` would have to be *both* `:last` *and* `:selected`.

---

**Update**:

Re your edit:

> 
> In this td, I have two select inputs.
> 
> 
> 

If they are not multi-select `select` elements, to get the selected `option` element:

```
opt = $("td.listas select:first option:selected"); // The first one
// or
opt = $("td.listas select:last option:selected");  // The last one -- this is your original selector

```

If they are multi-select, combine the two techniques above:

```
// The *last* selected option in the *first* select list:
opt = $("td.listas select:first option:selected").last();

// The *last* selected option in the *last* select list:
opt = $("td.listas select:last option:selected").last();

// The *first* selected option in the *first* select list:
opt = $("td.listas select:first option:selected").first();

// The *first* selected option in the *last* select list:
opt = $("td.listas select:last option:selected").first();

```
Your selector looks correct, where you might be going wrong is getting the value, you just need to add `.val()` on the end of it.

```
var lastSelVal = $("td.listas select:last option:selected").val();

```

**Rough demo:** [jsfiddle.net/Marcel/4m3jG/](http://jsfiddle.net/Marcel/4m3jG/4/)