开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜