x
 
            
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Fmpq教程(fmpq.com)</title>
</head>
<body>
年和周: <input type="week" id="myWeek" name="year_week">
<p>点击按钮返回 week 字段name属性值。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
    var x = document.getElementById("myWeek").name;
    document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>