If you want to view webpage source code, web inspector, error console and snippet editor in safari, you need to enable Safari Develop menu.
How to enable Safari Develop menu to view page source code
- Go to Safari menu -> Preferences -> Advanced.
- Check “Show Develop menu in menu bar”. Then close Safari preferences.
If you want to view any webpage source code,
Method 1: Open webpage in Safari and choose Develop menu -> Show Page Source.
Method 2: Right click on the web page (not on a image) and choose “Show page source” option.
Method 3: Keyboard short cut to view webpage source code : Command+Option+U.
This above method is same for all latest and old Mac OS X versions like OS X Yosemite, mavericks and mountain lion & Safari 8 browser.