I am trying to reduce some code here. I will explain how
I have multiple Button controls. I am using the click event for each
$("#B1").click(function() {
var v1 = "abc";
});
$("#B2").click(function() {
var v1 = "efg";
});
$("#B3").click(function() {
var v1 = "xyz";
});
I want to remove these 3 clicks event and write a single click event. If the click is from
B1 then v1 should be "abc"; B2 then v1 should be "efg"; B3 then v1 should be "xyz'
How can I write code in the best possible way