Worik wrote:
Friends
I have a submit button that I wish to change it's colour.
I have tried:
updateNodeAttributes('idOfButton', {'style': {'background-color':
'#ff0000'}});
And this does nothing.
What am I doing wrong?
I'm new to mochikit so maybe I'm in the wrong path, but I guess that you
need to pass as argument the computed style property name and not the
css declaration one. So change 'background-color' with 'backgroundColor'
and see what happens.
In general when referring to property names which have a hyphen in them
you just need to remove the hyphen and put in uppercase the first letter
of the second word. For example: font-weight = fontWeight, border-color
= borderColor ...
All this is because in Javascript (as in most programming languages) a
name can't have a hyphen in it since it's used as the arithmetic
subtract operation.
ciao,
ivan