我想在最簡單的事件中生成一個隨機數點擊嵌套事件點擊;但不是一個單一的數字,我得到了很多。在嵌套點擊事件的內部點擊事件中生成一個隨機數
的代碼如下:
$("#onePl").click(function(){
$("#firstP").fadeOut("slow",function(){
$("#secondP").fadeIn("slow",function(){
$("#theX").click(function(){
$("#secondP").fadeOut("slow",function(){
$("table").fadeIn("slow");
**var ran=Math.random();// *I want a single random number***
**console.log(ran);// I get lot of random numbers**
})
})
})
})
})
您可以發佈搗鼓呢? – Happy
是的,小提琴是:[小提琴](https://jsfiddle.net/cortazar11/16mxsu8r/) – user1881983