Please note that ExpatTech no longer operates regular office hours, meeting is by appointment only. Please call +36306031104 for details.

ExpatTech Techblog

Pető Zsolt 2008.11.19. 11:21

Changing website element properties dynamically

Sometimes very useful to change the properties of a website element when an event occurs. The key is the style member of the object.

function ChangeSomething()
{
    var obj = document.getElementById('valami');
    obj.style.backgroundColor = "#f0f0f0";
    obj.readOnly = true;
}


And here's the a list of Javascript equvivalent of the css properties: http://codepunk.hardwar.org.uk/css2js.htm