To call javascript you have to add
onblur="your_javascript_function" and if you don't want the postback return false from it.
<asp:textbox id="TextBox1" runat="server" autopostback="True" ontextchanged="TextBox1_TextChanged" onblur="return your_javascript_function()" xmlns:asp="#unknown">
</asp:textbox>
Also, this line
document.getElementById("TextBox1").innerText= 'Hi";
would not work due TextBox1 id in the html is NOT TextBox1, but something like Page_Ctl01_Ctl02_TextBox1
ASP.NET ensures that all control ids are unique and server mangles the ids you wrote so they are unique by prepending them with parents
You can access the element like this:
document.getElementById("<%=TextBox1.ClientID %>").innerText= 'Hi";
If this helps please take time to accept the solution. Thank you.