How to "wait" for user-interaction in a jquery-plugin (mapster)


I am a jquery-newbie. I am trying to setup a “geo-game”:

I want to ask the user in a “loop” for different countries like this:

  1. “Click on Egypt”
    if (e.key == ‘1’) {
    // message “Ok”
    // add one point
    else {
    // message “NOT Ok”

  2. “Click on Tunisia” …

  3. “Click on Gambia” …

I was able to setup my imagemap with mapster:

$(document).ready(function() {

function geklickt (e){
//alert(typeof e.key); return string
$(‘.showme’).append(e.key+ ’ ');

mapKey: 'ALT',
stroke: true,
strokeWidth: 2,
strokeColor: 'ff0000' ,
onConfigured: function(){
 //    howto set up "loop" for asking user here???

} ,
onClick: geklickt



(see my complete demo-example here:

I dont know howto setup my “query-loop” as described above.

Thanks for any hints