有没有一种方法可以在输入元素的焦点上激活本地HTML5日期选择器下拉菜单?
大型输入元素:
![大输入[类型=日期]元素](https://i.stack.imgur.com/xPH42.png)
目前,我只能在输入元素最右边的箭头上单击才能使用日历。
大型输入元素单击箭头
![大输入[type = date]元素onClick的箭头](https://i.stack.imgur.com/KeiLx.png)
我想在输入元素的焦点上激活此日历。
这是有问题的代码。
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<style media="screen">
.form-question {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 0 3rem;
min-height: 3rem;
}
.form-question__title {
color: #342357;
font-size: 1.5rem;
padding: 1rem;
}
.input-container {
border-bottom: solid 2px #333333;
}
.input-container input {
border: none;
box-sizing: border-box;
outline: 0;
padding: .75rem;
width: 100%;
}
</style>
<body>
<div class="form-question">
<div class="form-question__title">
<span>Effective Date</span>
</div>
<div class="input-container">
<input id="effective-date" type="date" name="effective-date" minlength="1" maxlength="64" …Run Code Online (Sandbox Code Playgroud)