I need the function to run once when the page loads, and then again whenever the button is clicked. If I take out the code to run it when the page loads, it works every time the button is clicked, otherwise it only works once on the page load and the button will never be pressed.
$(function()
{
});
$(document).ready(function()
{
$("#button").click(function()
{
});
});
source
share