I'm trying to use the id of a button that I got from clicking on it but it's not working

```
var idClicked;

$("input").click(function(e){
    var idClicked = $(this).attr('id');
});

$(idClicked).on('click',function(e){
    ...
});

```

Any suggestions?