문제

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

contentEditable="true"

but that's not working

도움이 되었습니까?

해결책

You have to set focus on the text box.

This can be done either by

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

or

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

or

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

다른 팁

In HTML5, you can simply use the input autofocus attribute.

However, beware that this does not work in some versions of IE.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top