I need a method similar to C# for jQuery.
Please provide the snippet.
Attached is the code for C# :
public static void Clear(params object[] boxes)
{
foreach (var box in boxes)
{
if (box != null && box is TextBox)
{
(box as TextBox).Text = string.Empty;
}
else if (box != null && box is Label)
{
(box as Label).Text = string.Empty;
}
else if (box != null && box is HiddenField)
{
(box as HiddenField).Value = string.Empty;
}
}
}
and it is called like this :
Clear(Textbox1,Label1);
thanks.