For example if you add a script in the master page
<script type="text/javascript">
function test() {
alert("It Works");
}
</script>
Then can assign to a button in other pages like these ways
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="test();"/>
OR from code behind
Button1.Attributes.Add("onclick", "test();");