Thanks for the code; I'll try testing it out. I'm not sure it would work for what I was intending, though. I really need all 28 links, because the passlock mechanism and ability of the keyboard to display what you typed depends upon six variables. (Five of these encode the letters themselves, and can range from one through twenty-six. Depending on which letter the character types, these will need to be set to different values. The last one detects if any of the characters entered so far was incorrect). Using your code seems feasible if I managed to encode variable restrictions and changes into the HTML code itself, but that sounds more complicated. I managed to get the keyboard itself working now, so I will stick with that for the moment.
Then again, I have basically no skill in HTML. (In fact, the little bits that I know were learned exclusively for this storygame). So I appreciate the code – it is useful information to know, and I might be able to use it in another puzzle.