
how do i change button color to black. meant to say i want black button with white text on it

Hi Friend,
Try the following code:
<html>
<script>
function getMes(){
var message=document.getElementById('msg').value;
alert(message);
}
</script>
<body>
Enter Message: <input type="text" id="msg"><br>
<input type="button" value="Submit" style="background-color:black; color:white;" onclick="getMes();">
</body>
</html>
Thanks

thanks for your reply. i could do it in this way
now my question is i have say 4 buttons arranged in 2X2 matrix i need to navigate among them using arrow keys how do i do it. now i have tab navigation. but i want arrow key navigation.

how do i post code snippet?

<button style="background-color:black;width:160;height:120;>text </button>
but this code will not resize the button why?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.