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: 
Initiate everything after document is ready.

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

```

also don't use event handlers until you need it.
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
    });
});

```