Monday, 23 August 2010

getElementById(ID)

Sometimes you want to be able to select a particular element from a web page. The getElementById(ID) JavaScript document object function returns the element whose ID is specified.

This simply lets you select any element from a document providing the means to perform an operation on that element. 

Some example JavaScript:
document.getElementById('div1').style.color = 'blue';
document.getElementById('input1').value = newvalue;

The id on the tag must be set:
<div id="div1"></div>
<input id="input1" type="text" />

Friday, 6 August 2010

MS Excel Alternate Row formatting

Colour alternate rows in MS Excel. Select the whole area choose Format > Conditional Formatting... and Add a new conditional formula, selecting the desired colour.

=MOD(ROW(),2)

Easy and if you add new rows it updates the colours automatically.