<html>
<head>
</head>
<body>
<input type='text' class='i_am_input' value='good'>
<input type='text' class='i_am_input' value='bad'>
<input type='text' class='i_am_input' value='good'>
<input type='text' class='i_am_input' value='bad'>
<input type='text' class='i_am_input' value='good'>
<script>
i_am=0
;[].forEach.call(document.querySelectorAll(".i_am_input"), function(el){
if(el.value==="good") i_am++
})
alert(i_am)
</script>
</body>
</html>