This paper focuses on investigating the dynamic cross-correlation relationship between online sentiment and returns of major global stock markets based on the MF-DCCA method. We use Daily Happiness (DHS), an index derived from Twitter posts through textual analysis as a proxy of online sentiment. By dividing the global financial markets into developed and developing ones, we are able to test the heterogeneous relationship between stock market performance and sentiment at different economic developing level. Empirical results show that there exists a power-law cross-correlation relationship between financial market and online sentiment in some developed countries and all developing countries, and the relationship is more stable in the developing countries. Moreover, we apply rolling window analysis to capture the dynamic evolution characteristics and find the relationship has a strong consistency over time. Our work provides a much more delicate perspective to test the relationship between online sentiment and financial markets performance and enriches the existing literature.