Home » , , , » View source code with a button

View source code with a button

If you're looking for a simple way to enable your visitors to view your source code, this JavaScript code is for you. By adding this simple little JavaScript code to your web site, you can create a button that, when clicked on, will open your source code.

This script is useful for sites that are teaching any type of web design coding and need an easy way for their visitors to view their source code.




Copy and paste this code into your HTML where you would like the button to appear:
<form>
<input type="button" value="View Source"
onClick= 'window.location = "view-source:" + window.location.href' >
</form>
Share this article :

0 comments:

Post a Comment

 
Copyright © Online Business - All Rights Reserved
Proudly powered by Blogger