HTML enterkeyhint属性与软键盘确定文案实例页面

回到相关文章 »

效果:

1. 默认

2. enterkeyhint设置为done

3. enterkeyhint设置为search

代码:

CSS代码:
input {
    padding: 5px 10px;
}
HTML代码:
<h4>1. 默认</h4>
<form>
    <input type="search" placeholder="搜索,focus me"> <input type="submit" value="提交">
</form>
<h4>2. enterkeyhint设置为done</h4>
<form>
    <input type="search" enterkeyhint="done" placeholder="搜索,focus me"> <input type="submit" value="提交">
</form>
<h4>3. enterkeyhint设置为search</h4>
<form>
    <input type="search" enterkeyhint="search" placeholder="搜索,focus me"> <input type="submit" value="提交">
</form>