这是我的代码:
<html>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Kalendae/0.7.1/kalendae.css" type="text/css" charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Kalendae/0.7.1/kalendae.standalone.js" type="text/javascript" charset="utf-8"></script>
<body>
<script type="text/javascript">
function myFunction() {
alert("toto");
document.getElementById("testKal").draw(); // i want to activate the draw function of auto-kal
}
</script>
<img src="https://www.dropbox.com/s/hz8nrhh0yosvpgy/calendar.png?dl=1" id="imgTest" onclick="myFunction()"> <input type="text" class="auto-kal" id="testKal">
</body>
</html>
我希望当我单击日历图片时,弹出输入文本的日历。
这是万寿菊的功能图。
我还试图在单击图像时激活testKal的click()函数:
<html>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Kalendae/0.7.1/kalendae.css" type="text/css" charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Kalendae/0.7.1/kalendae.standalone.js" type="text/javascript" charset="utf-8"></script>
<body>
<script type="text/javascript">
function myFunction() {
alert("toto");
document.getElementById("testKal").click(); // i want to activate the draw function of auto-kal
}
</script>
这里是绘制功能的小提琴:
https://jsfiddle.net/bussiere/wfj7bk3m/6/
还有一个尝试通过点击的广告:
答案 0 :(得分:2)
您需要触发输入的焦点事件
document.getElementById("testKal").focus();
答案 1 :(得分:0)
Comparator<String> property1Comparator = Comparator.nullsLast(Comparator.<String, Boolean>comparing(
property1 -> !property1.startsWith("Hi")
).thenComparing(Comparator.naturalOrder()));