This article shows you how to view HTML source code in Safari.
Viewing the source code in Safari is easy:
Navigate to the web page you want to view.
Select the Develop menu from the top menu bar. Select the Show Page Source option to open a text window with the HTML source of the page.