<input type="submit" value="Login" onclick="myFunction">
<!-- Project -->
<script>
function myFunction(){
document.getElementById("input[tpye="submit"]").style.backgroundColor="blue";
}
</script>
getElementById gets the element with that id. You're probably looking for querySelector instead, which will select the element that matches that selector:
function myFunction(){
document.querySelector("input[type='submit']").style.backgroundColor="blue";
}
You have done three mistakes in your code snippet
<input type="submit" value="Login" onclick="myFunction()">
<!-- Project -->
<script>
function myFunction(){
document.querySelector("input[type='submit']").style.backgroundColor="blue";
}
</script>
In the javascript function you are using 'getElementById' which means that it'll look for the DOM elements with the id you have provided, and the problem is you didn't provided any id.
You have to first give an id to the button
<button id="some_id">Click</button>
And then align your function in this way.
function myFunction(){ document.getElementById("some_id").style.backgroundColor="blue"; }