Created
April 19, 2017 10:36
-
-
Save pixelbart/c23e2f39e467f0a230386f4d10abb0a0 to your computer and use it in GitHub Desktop.
A simple color picker for/with html and jquery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label class="kevin-color"> | |
<input type="text" name="kevin_color" value="" /> | |
<input type="color" name="kevin_color" value="" /> | |
</label> | |
<script> | |
jQuery('.kevin-color input[type="color"]').on( 'change', function() { | |
var ValColor = jQuery(this).val(); | |
jQuery('.kevin-color').find('input[type="text"]').val(ValColor); | |
}); | |
jQuery('.kevin-color input[type="text"]').on( 'change', function() { | |
var ValColor = jQuery(this).val(); | |
jQuery('.kevin-color').find('input[type="color"]').val(ValColor); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment