【发布时间】:2022-01-11 05:01:35
【问题描述】:
有一个年龄选择器。
如果 18-31 岁/岁 >按钮 > 链接到网站.......
Otherwish 32-99 y/old > 相同的按钮 > 链接到另一个
可能的代码:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Add your Age</title>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css">
<script>
$( function() {
$('#datepicker').datepicker({
changeMonth:true,
changeYear:true,
yearRange:"1920:2021"
});
$('#datepicker').datepicker('show');
} );
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker"></p>
<button style="background: orange; border: none;padding: 10px 25px;margin-left:40px;">Ok</button>
</body>
</html>
【问题讨论】: