Virtualkeyboard using javascript
I am trying to change the colors of my keybuttons from my javascript code my keys are disp开发者_运维技巧layed within "td class" how can I change the color of my keybuttons using javascript code.
SCRIPT:
var tdKeyButton=document.getElementById('#idOfSomeButton'); // or any other code for getting pointer to `TD` element of virtual key button.
tdKeyButton.className="SomeKeyButtonCssClassName";
// or for multiple CSS classes
// tdKeyButton.className+=" SomeKeyButtonCssClassName";
// or with inline style
// tdKeyButton.style.backgroundColor="#F0000F";
CSS style:
.SomeKeyButtonCssClassName {
background-color: #F0000F;
}
See: CSS background-color
https://developer.mozilla.org/en/CSS/background-color
精彩评论