Mohammed, who founded Islam in 622 CE, was born and raised in present-day Saudi Arabia, he never set foot in Jerusalem.
His connection to the city came years after his death when the Dome of the Rock shrine and the al-Aqsa mosque were built in 688 and 691, respectively, their construction spurred by political and religious rivalries.
In 638 CE, the Caliph (or successor to Mohammed) Omar and his invading armies captured Jerusalem from the Byzantine Empire. One reason they wanted to erect a holy structure in Jerusalem was to proclaim Islam's supremacy over Christianity and its most important shrine, the Church of the Holy Sepulcher.
More important was the power struggle within Islam itself. The Damascus-based Umayyad Caliphs who controlled Jerusalem wanted to establish an alternative holy site if their rivals blocked access to Mecca. That was important because the Hajj or pilgrimage to Mecca was (and remains today) one of the Five Pillars of Islam. As a result, they built what became known as the Dome of the Rock shrine and the adjacent mosque.
To enhance the prestige of the "substitute Mecca," the Jerusalem mosque was named "al-Aqsa." It means "the furthest mosque" in Arabic, but has far broader implications, since it is the same phrase used in a key passage of the Quran called "The Night Journey." In that passage, Mohammed arrives at "al-Aqsa" on a winged steed accompanied by the Archangel Gabriel, from there they ascend into heaven for a divine meeting with Allah, after which Mohammed returns to Mecca.
It goes on with some interesting history about Jerusalem itself, especially the manner in which it was left to decay, until Israel rejuvenated Islamic claims.
One thing I think it misses out on is it describes the Night Journey as a visit to the prophets of Islam, but one key element (for me anyway) is that it included Judaic and Christian prophets. This seems important as Mo is able to fly (on a winged horse) back to earth and say he has spoken to Moses, Abraham and Jesus and they all agreed Mo was the latest, greatest and final prophet.