Move onclick actions to inside doc.ready. Change button type to
button.