I want alert to pop if input letters length is equal to 0 but it is not working
<div class="rame">
<input type=text placeholder="Name" style="position: relative; right:-750px" id="inp1">
<input type=text placeholder="Name2" style="position: relative; right:-250px" id="inp2">
<button onclick="check()">submit</button>
</div>
<script>
function check() {
var a = document.getElementById("inp1");
var b = document.getElementById("inp2");
if (a.length = 0) {
alert("Hello World")
}
}
</script>