node2:/var/www/html#cat a17.html
<input type="checkbox" value="1" name="check" checked/>
<input type="checkbox" value="2" name="check"/>
<input type="checkbox" value="3" name="check" checked/>
<input type="button" value="你选中的个数" id="btn"/>
<script type="text/javascript" src="jquery-2.2.2.min.js"></script>
<script type="text/javascript" src="a17.js"></script>
node2:/var/www/html#
node2:/var/www/html#cat a17.js
var btn = document.getElementById("btn"); //获取id为btn的元素(button)
console.log(btn);
<input value="你选中的个数" id="btn" type="button">