<html>
<body>
<h1>Change caret-color with JavaScript</h1>
<input id="input1" class="custom" value="Custom caret color">
<p>Click the "Try it" button to set the caret-color property to "red":</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("input1").style.caretColor="red";
}
</script>
</body>
</html>