Home >Web Front-end >Front-end Q&A >What to do if the cursor does not appear when clicking the input in HTML

What to do if the cursor does not appear when clicking the input in HTML

藏色散人
藏色散人Original
2021-02-25 10:36:264477browse

htmlThe solution to the problem that the cursor does not appear when clicking on the input: First open the corresponding HTML file; then use jquery to write the cursor when clicking on it. The code is such as "$('.inputname, .inputphone').on(' touchstart',function...)".

What to do if the cursor does not appear when clicking the input in HTML

The operating environment of this article: Windows 7 system, HTML5, Dell G3 computer.

html5 The perfect solution for the cursor not appearing when clicking the input

<input type="text" placeholder="输入姓名" class="inputname" id="id_name">
<input type="text" placeholder="输入手机" class="inputphone" id="id_phone">

Use jquery directly to write the cursor when clicking the input

$(&#39;.inputname, .inputphone&#39;).on(&#39;touchstart&#39;,function () {
$(this).focus();
})

[Recommended: HTML video tutorial]

The above is the detailed content of What to do if the cursor does not appear when clicking the input in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn