Playgrounds
Snippets
Developers
Compiler
All
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
Coffee
CoffeeScript
ColdFusion
Command
CSS
Delphi
Django
ES6
GLSL
Grunt
Gulp
HAML
Haskell
HTML
iOS
Jade
Java
JavaScript
jQuery
JSX
Less
LUA
MDX
MySQL
Objective
Other
Pascal
Perl
PHP
Plain text
PowerShell
Processing
Progress
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
SCSS
SmallBASIC
Smarty
SQL
Stylus
SVG
Swift
TypeScript
VHDL
X++
XHTML
XML
Xojo
XSLT
New snippet
New playground
Sign up
Login
Upload
Playgrounds
Snippets
Developers
Sign up
Login
Codepad is a place for developers to share code snippets (PHP, Java, Bash, C, C++, Python and more). Create your HTML, CSS and JS Demos.
Sign up
Learn more
Sort
Popular
Most liked
Most recent
Time
Today
Last week
Last month
Last year
All time
Select Languages
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
ColdFusion
Command
CSS
Delphi
Django
Grunt
Gulp
HAML
HTML
iOS
Jade
Java
JavaScript
jQuery
Less
MySQL
Objective
Other
Pascal
Perl
PHP
PowerShell
Processing
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
Smarty
SQL
Swift
VHDL
XHTML
XML
Xojo
XSLT
SCSS
CoffeeScript
GLSL
Progress
Stylus
ES6
Coffee
TypeScript
X++
Haskell
SmallBASIC
JSX
SVG
Plain text
LUA
MDX
Apply
Reset
popular • JavaScript
Javascript window.location
JavaScript
3
1
3636
Disabled Space Bar When Cursor Inside Text Field
JavaScript
3
1
3940
Extract youtube video ID from url or share link
JavaScript
0
11
2997
Back Button
JavaScript
2
3
2789
Trigger Click On Page Load
JavaScript
0
4
3035
Load the Facebook SDK Asynchronously
JavaScript
0
5
3270
Module pattern - IIFE
JavaScript
0
8
3187
var code
JavaScript
0
0
2694
Test
JavaScript
1
1
2771
Simple Redirect with Delay
JavaScript
0
0
2631
Simple Redirect with Delay (Break out of iframe)
JavaScript
0
0
3481
Replace all non-numeric characters
JavaScript
0
2
2566
Globe Chart Geomap using an Flash player
JavaScript
0
6
2816
Generating random numbers
JavaScript
0
5
3134
Detect Orientation
JavaScript
0
3
2681
Scale fix for iPhone/iPad orientation change
JavaScript
0
4
2712
Mobile Detech
JavaScript
0
1
2852
MatchMedia
JavaScript
0
1
2862
iPhone Touch Events in JavaScript
JavaScript
0
7
2789
iPhone Touch Events in JavaScript
JavaScript
0
2
2930