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
Playground Settings
HTML
CSS
JAVASCRIPT
HTML Preprocessor
HTML
HTML
HAML
JADE
Stuff for <head>
Save
Cancel
CSS Preprocessor
CSS
CSS
SASS
SCSS
LESS
Stylus
Quick Add
---
Animate.css
Bootstrap
Foundation
Add external resource
External CSS
x
Save
Cancel
Javascript Preprocessor
Javascript
Javascript
Babel
TypeScript
Coffee
Quick Add
---
Angular
Backbone
Bootstrap
D3
Ember
GreensockTweenMax
Handlebars
jQuery
jQuery UI
Knockout.js
Lodash
Modernizr
Polymer
React
React DOM
Snap.svg
Three.js
Underscore
Zepto
Add external resource
External JS
x
Save
Cancel
JavaScript Color Picker
HTML
<input type="text" value="#ffa500">
CSS
body { padding: 50px; }
JAVASCRIPT
var body = document.body, target = document.querySelector('input[type=text]'), picker = new CP(target); picker.on("change", function(color) { body.style.backgroundColor = '#' + color; target.value = '#' + color; });
Run
Expand for more options
Login
A simple color picker plugin written in pure JavaScript, for modern browsers.
https://github.com/tovic/color-picker
0
9
2318
Share
Created by
Taufik Nurrohman