I've done my searches and tried in different ways but i don't understand why my problem persist.

I want to store the number of links inside a div into a javascript variable.

If i do this, it works:

```
alert ($("#uploaded-files a").length); // i can see the alert with the right value (5)

```

Then I tried to store the previous result into a javascript variable:

```
var mynumber = $("#uploaded-files a").length;
alert (mynumber)  // i can see the alert but the value is 0 and not 5

```

I also tried this one

```
var mynumber = $(("#uploaded-files a").length).val();  
alert(mynumber ); // i don't even see the alert message box

```