How to Change the Color of Text in HTML using JQuery

Change the Color of Text in HTML using JQuery

In this example, We will show you about, How to change the color of text in Html using JQuery. The example has been tested and output shared in the same post.

JQuery Script

function chnageTextColor(value) {
	
	$('#content').css("color", value);
}

Complete Example

<html>

	<head>
		<title>How to Change the Color of Text in HTML using JQuery</title>
	</head>
	
	<body>
	
		<h1 id="content">
			Hello World
		</h1>
		
		<div>
			
			<input type="color" onchange="chnageTextColor(this.value);">
			
		</div>
		
		<script>
		
			function chnageTextColor(value) {
				
				$('#content').css("color", value);
			}
		
		</script>
		
		<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
	
	</body>

</html>

Output

How to Change the Color of Text in HTML using JQuery