Answers for "color change on click jquery"

1

jquery onlcick css change

$('.colors-list li').click(function(e){
    $('.results').css('background-color', 'red');
});
Posted by: Guest on March-19-2021
-1

on click change color of text

<!DOCTYPE html>
<html>
<head>
    <title>Change Color</title>
</head>
<body>
<button id="changeGreen">Change Font Color Green</button>
<button id="changeRed">Change Font Color Red</button>
<p>
<span id="output">Learn the test-driven development approach when building apps</span>
</p>
<script>

document.getElementById("changeGreen").onclick = function(){
	document.getElementById("changeGreen").style.color = 'green';
}

document.getElementById("changeRed").onclick = function(){
	document.getElementById("output").style.color = 'red';
}
</script>
</body>
</html>
Posted by: Guest on July-04-2021

Code answers related to "color change on click jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language