I have made a simple javascript function that gets executed on button click -
<asp:TextBox ID="TextBox3" runat="server" Width="98px"></asp:TextBox>
<asp:Button ID="Button3" runat="server" Text="Button" OnClientClick="fn4();" />
<script type="text/javascript">
function fn4()
{
var search = document.getElementById('TextBox3').value;
<iframe src="http://fooBar.com/q=" + search + " width="250" height="400" scrolling="no" frameborder="0"></iframe>
}
</script>
So the search term is based on the user input from TextBox3, however when this is executed, it brings up the error -
Error: 'fn4' is undefined
How can I resolve this?