Cramer: Hotels undervalued because of this

Now may be a good time to invest in hotels because the space is undervalued, CNBC's Jim Cramer said Friday.

"Airbnb is doing incredibly well, and a lot of people are staying away from hotels because of Airbnb. Airbnb's biggest problem is they don't have enough inventory, so I don't think hotels are nearly as threatened," Cramer said on "Squawk on the Street."

Cramer made his remarks after Starwood Hotels & Resorts Worldwide agreed to sell itself to Anbang, a Chinese insurer.

"Anbang's basically saying Airbnb has reduced the value of all hotels," he said.

The Chinese firm, whose offer for Starwood is already fully financed, has been an aggressive buyer of U.S. hotel properties of late. It already owns New York's iconic Waldorf-Astoria.

Shares of Starwood were up 3.6 percent in early afternoon trading Friday.

Disclosure: Cramer's trust did not own shares of Starwood when this article was published.