I am currently creating a flashcard system that randomly selects a value from an array.
However I would also like for another button "switchBtn" to change the random value that is displayed.
Is there anyway to do this ?
current code:
var kanaArray = ["あ","い","う","え","お","か","き","く","け","こ","さ","し",
"す","せ","そ","た","ち","つ","て","と",
"な","に","ぬ","ね","の","は","ひ","ふ","へ",
"ほ","ま","み","む","め","も","や","ゆ","よ","ら","り","る",
"れ","ろ","わ","を","ん"]
var kanaPassed = []
let kanaShown = kanaArray[Math.floor(Math.random()*kanaArray.length-1)];
//logic
var started = false;
// kana buttons queries
$(document).ready(function(){
$(".startBtn").click(function(){
started = true
$('.startBtn').css("visibility", 'hidden');
$('.switchBtn').css("visibility", 'visible');
$('h3').text(kanaShown);
$('h3').css("visibility",'visible')
console.log(started)
})
});
$('.switchBtn').click(function(){
});
Aucun commentaire:
Enregistrer un commentaire