Actually thats quite an interesting question: When did the Kingdom of Hungary become an elective monarchy?With that being said, nothing really stops the nobility from trying to elect anyway. Given though, that even IOTL the floor was mopped with Szapolyai quite fast(, atleast until the Turks got involved), I don't think he could fair much better ITTL, when there's an unquestionable rightful heir to the throne.
Because I know when it changed back to a hereditary monarchy (1687), I know that before that it was nominally an elective monarchy though in reality the heir of the actual Habsburg ruler was always elected. However in the middle ages I think the kingdom was a hereditary monarchy. So when did it switch to elective?