i'm trying to make a drag and drop quiz, each question is on a different html page and i need to get the result so i made a javascript in an external javascript file it worked on 1 html page but it doesn't on multiple pages, like .. the function is resetting itself. i'm so not pro in programming so here's the counter js.js file
var count=0;
function fun() {
count=count+1;
}
function result(){
document.write("your mark is " + count + " from 9")
}
and here's the code in the other pages .. i made 3 just to test it
if ( slotNumber == cardNumber ) {
ui.draggable.addClass( 'correct' );
ui.draggable.draggable( 'disable' );
$(this).droppable( 'disable' );
ui.draggable.position( { of: $(this), my: 'left top', at: 'left top' } );
ui.draggable.draggable( 'option', 'revert', false );
correctCards++;
fun();
}
so how can i call it on a different pages without having it reset itself ?