Saturday, 17 August 2013

jquery -function in event just one time

jquery -function in event just one time

i have the following code
<input id="inputID1" value="click me" type="button" />
<input id="inputID2" value="click me again!" type="button" />
the script
$("#inputID1").click(function()
{alert("inputID1 click");
$("#inputID2").click(function()
{funcWaitToInput();
return;});
}
);
function funcWaitToInput()
{alert("just one time");}
I mean that after inputID1 clicked, wait to inputID2 cliked and run
funcWaitToInput() function in the first inputID2 click,
but, Every time I press inputID2 button function occurs again
I want that after inputID1 clicking is waiting to clicking on the
inputID2, And the funcWaitToInput() function run only the first click,
I was looking for how to do it and not found

No comments:

Post a Comment