I need to pass a model value item.ID to one of my javascript function how can I do that ?

I tried`function("@item.ID")` but its not working
['https://Stackoverflow.com/questions/18849257', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1858684/']
It generally works this way, you just have to omit the `""` otherwise it gets interpreted as string. So you can write something like that in your JS:

```
var myinteger = @item.ID;

```

which renders as

```
var myinteger = 123;   //for example

```

Edit: This makes sense when you id is an integer, of course, for strings you need to encapsulate it in `''` or `""`. And don't get annoyed by any syntax errors reported by intellisense, it seems to have a problem with that but it works out just nicely.
Try this...mind single quotes on parameter value while calling js function

```
function MyJsFunction(modelvalue)
{
     alert("your model value: " + modelvalue);
}

<input type="button" onclick="MyJsFunction('@item.ID')" />
OR
<input type="button" onclick="MyJsFunction('@(item.ID)')" />

```