If I insert runat="server", the control will be accessible only from the server.
<input id="txtSearch" runat="server"/> // Accessible only from C#
runat="server", .net web form will do some modifications to your controls, in this case your
input's ID will no long is txtSearch anymore, that would be something like "form_1abcasd_txtSearch". You could fix the issue by
ClientIdMode="Static" to get rid of that.
If you are using jQuery, you could use
$("input[id$='txtSearch']") to access the element as well.