I have a button where on clicking the button it will clear all the textbox and drop down values now i need to create a common function and place my below jquery code in that common function so that i can call that function in button2,button3 click events of jquery
<input type="button" value="Clear" title="clear" id="btnclear" />
<input type="button" value="" title="clear" id="btn2" />
<input type="button" value="" title="clear" id="btn3" />
// I need to place the below code in a function to use the function in remaining click events
$('#btnclear').off('click').on('click', function (RD) {
$('#txtname').val("");
});
$("#btn2").click(function () {
// I need to call the created common jquery function to clear the fields
});
$("#btn3").click(function () {
// I need to call the created common jquery function to clear the fields
});