我需要从数据列表中获取值吗?
目前,我为2参数yoursign和friendsign定义了
例如,如果我为您的手势选择白羊座,为friendSign选择狮子座,则我需要同时获取两者并传递给函数
<body>
<form id="Match"></form>
<label for="yourSignList">your sign:</label><br /><input list="yourSignList" name="sign1" required><br />
<datalist id="yourSignList">
<option value="Aries">
<option value="taurus">
<option value="Gemini">
<option value="Cancer">
<option value="Leo">
<option value="Virgo">
<option value="Libra">
<option value="Scorpio">
<option value="Saggitarius">
<option value="Capricon">
<option value="Aquarius">
<option value="Pisces">
</datalist>
<label for="friendSignList">your friend sign:</label><br /><input list="friendSignList" name="sign2" required><br />
<datalist id="friendSignList">
<option value="Aries">
<option value="taurus">
<option value="Gemini">
<option value="Cancer">
<option value="Leo">
<option value="Virgo">
<option value="Libra">
<option value="Scorpio">
<option value="Saggitarius">
<option value="Capricon">
<option value="Aquarius">
<option value="Pisces">
</datalist>
<button type='submit' onclick="Match()">Done</button><br>
<label for="output">התאמה: </label><output id='output'></output>
<form />
<script>
function Match() {
const signYours = $("yourSignList").val();
const signFriend = $("friendSignList").val();
$("#output").val(answer(signYours, signFriend));
}
红糖糍粑
aluckdog
相关分类