To set the cursor color, use the CSS caret-color property. You can try to run the following code to implement the caret-color property
Example
<!DOCTYPE html>
<html>
<head>
<style>
.demo {
caret-color: blue;
}
</style>
</head>
<body>
<p>Place the mouse cursor below to see a blue color cursor</p>
<input class = "demo" value = "Blue Cursor"><br><br>
</body>
</html>