Yes, JavaScript variables will exist in the scope they are created.
var bannerID = 55;
<input id="EditBanner" type="button"
value="Edit Image" onclick="EditBanner(bannerID);"/>
function EditBanner(id) {
//Do something with id
}
If you use event handlers and jQuery it is simple also
$("#EditBanner").click(function() {
EditBanner(bannerID);
});