I have a textfield (fullname) and on click of the button "Set Focus", i want the focus to be set on the textfield(fullname) but do not want the blinking cursor within the focused textfield. How can this be achieved using js/jQuery.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Customer Details</title>
</head>
<body>
<input type="text" id="fullname" placeholder="Name">
<button type="button" onClick="document.getElementById('fullname').focus()" id="button">Set Focus</button>
</body>
</html>
I have tried using both jquery and js focus()
. But in both the cases, i could see blinking cursor in the focused textfield. I saw a solution which requires me to alter the text-shadow, border and outline to achieve this. But i want to retain the border and outline for the focused textfield