页面加载后如何使文本输入框光标自动闪烁? [英] How do I make the text input box cursor blink automatically when the page loads?

查看:65
本文介绍了页面加载后如何使文本输入框光标自动闪烁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望文本框中的光标/行内容在页面加载时自动开始闪烁.我已经尝试过

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

contentEditable="true"

但这不起作用

推荐答案

您必须将重点放在文本框上.

You have to set focus on the text box.

这可以通过

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

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

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

HTML5 <输入type ="text" name ="fname"自动对焦/>

这篇关于页面加载后如何使文本输入框光标自动闪烁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆