Question: I want to Pass the variable with click event in jquery

```
var get=3; 
$('#edit').click(function(event){
alert('You are getting:' + get);
}

```

please help me

html 

```
<input type='submit' name='action' id='edit' />

```

Answer: 
You have to initialize click even once document is loaded. Also you have syntax error in your code.

Try this one:

```
$(document).ready(function() {
    var get=3;
    $('#edit').click(function(event){
        alert('You are getting:' + get);
    });
});

```

```html
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
        var get=3;
        $('#edit').click(function(event){
            alert('You are getting:' + get);
        });
    });
    </script>
</head>
<body>
    <input type='submit' name='action' id='edit' />
</body>
</html>
```
You can do it like this:

```
$(document).ready(function() {
    var get = 3;
    $("#edit" ).bind("click", { key: get }, function(event){
        // event.data.key will have value of get
    });
});

```