Anti-American demonstrations in the Islamic world spread yesterday to Turkey, India and Bangladesh.

The demonstrations came as American diplomats were held hostage for the 19th day at the U.S. Embassy in Tehran. They also followed the sacking of the U.S. Embassy in Islamabad, Pakistan, Wednesday by an angry crowd.

In northwest India, angry Moslems marched through the streets of the town of Srinagar. The crowds, angered by the seizure of the Great Mosque in Mecca by Moslem extremists, denounced President Carter and chanted "Moslems of the world unite," according to the United News of India.

Erroneous reports that the United States had been responsible for the takeover of the Mecca mosque had sparked the attack on the Pakistan embassy, in which two Americans died.

In Izmir, Turkey, students, who apparently believed the United States was responsible for the attack on the Great Mosque in Mecca, smashed windows with rocks at the U.S. consulate and the consul's residence yesterday.

About 150 students from the city's Islamic Institute reportedly marched on the consulate shouting "American imperialists, hands off the holy places of Islam." Riot police eventually dispersed the students and took five of them into custody, according to the semiofficial Anatolian News Agenc.

The agency said security measured were increased to protect the building occupied by Americans living in Izmir. The Islamic Institute reportedly was closed for the day.

The seemingly widespread notion that the United States was behind the Mecca mosque takeover stemmed from areawide Iranian radio broadcasts Tuesday quoting Iran's revolutionary Ayatollah Ruhollah Khomeini as making the connection.

In Dacca, Bangladesh, several thousand demonstrators marched through the streets in a protest that also was sparked by the seizure of Islam's holiest shrine.

The marchers made no specific reference to any country and were quickly dispersed by security forces.

However, about 500 youths had crowded outside the U.S. Embassy in the Bangladesh capital earlier in the day, chanting "down with American imperialism" and accusing the Central Intelligence Agency of involvement in the "dastardly attack" on the mosque.

As in Pakistan and Turkey, the youths aparently were inspired by Khomeini's broadcast allegations of American complicity in the Mecca assault.

The demonstration at the U.S. Embassy came on the heels of a smaller march Wednesday night by about 200 students blaming Iran for the Mecca attacks. The Iranian Embassy in Dacca issued a statement declaring that Iran had no hand in the seizure and warning the public against "false propaganda."