使用js验证年龄是否有18岁var idCardEl = document.getElementById("idcard")var idcard = idCardEl.val()var birthYear = idcard.substring(6,2023-02-21JavaScript180