akshay1728
02-07-2012, 01:25 PM
i have button.js file which contains 2 fuction
button.js
function displayclue()
{
$("#butt").click(function(){
$("#clue").load('clue.txt');
});
return false;
}
function displayclue1()
{
$("#but").click(function(){
$("#clue1").load('clue1.txt');
});
return false;
}
and my html code is
<p id="clue1"> WANT CLUE CLICK HERE <button id="but" onclick="displayclue1()"> GET CLUE </button></p>p
<br />
<br />
<p id="clue">NEXT CLUE <button id="butt" onclick="displayclue()"> NEXT CLUE</button> </p>
first button requires only one click while second button requires 2 click
what is wrong with my code??i tried lot of things but no result
thank you
button.js
function displayclue()
{
$("#butt").click(function(){
$("#clue").load('clue.txt');
});
return false;
}
function displayclue1()
{
$("#but").click(function(){
$("#clue1").load('clue1.txt');
});
return false;
}
and my html code is
<p id="clue1"> WANT CLUE CLICK HERE <button id="but" onclick="displayclue1()"> GET CLUE </button></p>p
<br />
<br />
<p id="clue">NEXT CLUE <button id="butt" onclick="displayclue()"> NEXT CLUE</button> </p>
first button requires only one click while second button requires 2 click
what is wrong with my code??i tried lot of things but no result
thank you