Avoiding refreshing the entire page when clicking a button

Well, this example worked for me: