Answer the question
In order to leave comments, you need to log in
How to put multiple buttons on one form?
hello i have a form
<form action="" >
<input type="text" >
<button type="submit">send</button>
<button onclick="changeColor()">make green</button>
</form>
<script>
function changeColor(){
document.body.style.backgroundColor="green";
}
</script>
Answer the question
In order to leave comments, you need to log in
The last button should be changed like this:
<button type="button" onclick="changeColor()">make green</button>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question