I\'m trying make some stuff in jQuery using ASP.NET. But the ID from runat=\"server\" is not the same as the id used in HTML.
I used to use this to get
As others have mentioned, you can pass a class selector to jQuery, but that is a bit messy. I prefer to use the jQuery attribute ends with selector. Given that a generated ID is a flattened hierarchy of controls, you can use the "ends with" selector to find your element.
When rendered, the generated ID becomes something like this (if within a masterpage's content place holder):
To find this control:
$("input[id$='txtText']")
Take caution when using this within a repeater.