Use this.className
instead this.class
<input type="text" value="Username" name="Username" onblur="if (this.value === '') {this.value = 'Username'; this.className='Offline'}" onfocus="if (this.value === 'Username') {this.value = ''; this.className='Online';}">
Update
You have to change the condition, as the condition wasn't satisfying and class wasn't applied:
<input type="text" value="Username" name="Username" onblur="if (this.value != '') <-- Here {this.value = 'Username'; this.className='Offline'}" onfocus="if (this.value === 'Username') {this.value = ''; this.className='Online';}">