Take 2 textboxes and compare their's values like
function txtValuesCompare()
{
var txt1 = document.getelementbyid("textbox1").value;
var txt2 = document.getelementbyid("textbox2").value;
if(txt1 == txt2)
{
alert("values are same");
return true;
}
else
{
alert("values are not matching");
return false;
}
}
<asp:textbox id="textbox1" runat="server"></asp:textbox>
<asp:textbox id="textbox2" runat="server"></asp:textbox>
<asp:button id = "btnCompare" runat = "server" onclientclick = "txtValuesCompare();" text="Compare" /><asp:button>