Since the id of a tag with runat="server" has nothing to do with the id attribute of same tag on the client (after it has been rendered to HTML) you'll have to do this in the javascript of your .aspx page:
function showMyTextBoxValue()
{
var textBox = document.getElementById("<%= txt1.ClientID %>");
alert(textBox.value);
}
Alternately you can have the javascript code outside your .aspx page:
function showMyTextBoxValue(elementName)
{
var textBox = document.getElementById(elementName);
alert(textBox.value);
}
but this means when you call this javascript function (linked into your .aspx page via script tag with src attribute) on your .aspx page you'll have to do something like this:
<input id="test" name="test" value="Show textbox value!" onclick="showMyTextBoxValue('<%= txt1.ClientID %>')"/>
Best Regards,
-MRB