I have the following HTML code:

```
<section>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</section>

```

I have the following jQuery code:

```
$("div").on("mouseenter", function (){
    myidx = $(this).index();
    return myidx;
});

var x = something // The value myidx;

```

I want to assign the output of the function executed on `mouseenter` which is the value of `myidx` to var `x`. So that: var `x` = the value of `myidx`.