2017-05-01 17 views

答えて

0

はい、そうです。可能jqueryのイマイチなし

var input = document.getElementById("changetext"); 
 
var text = document.getElementById("text"); 
 

 
input.addEventListener('change', function() { 
 
    text.style.color = this.value; 
 
});
<input id="changetext" type="color"> 
 
<p id="text">Text<p>

またはjQueryの

$('input[type="color"]').on('change', function() { 
    $("p").css("color", $(this).val()); 
}); 
+0

と? – cezar40

+0

あなたのプロジェクトにそれがある場合です。例:https://jsfiddle.net/3adgu29w/ – Tymek

関連する問題