mango mango - 1 year ago 102
CSS Question

How do I make the text input box cursor blink automatically when the page loads?

I want the cursor/line thing in the text box to automatically start blinking when the page loads. I've tried


but that's not working

Answer Source

You have to set focus on the text box.

This can be done either by

JavaScript document.getElementById("fname").focus();


Jquery $( "#fname" ).focus();


HTML5 <input type="text" name="fname" autofocus />

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download