JavaScript basic question

Posted by refge on Stack Overflow See other posts from Stack Overflow or by refge
Published on 2010-05-13T21:58:09Z Indexed on 2010/05/13 23:34 UTC
Read the original article Hit count: 191

Filed under:
|
|
|

I have this small JavaScript code which I need some help with:

function doFocus(text) {
    if (text.value == "Enter Name") {
       text.value = "Student Name -";
    }
}

All I need here is when someone clicks on my textbox, the text "Student Name -" should change its color, and should text-align = left. I am looking for the appropriate syntax for something like text.color and text.align.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about textbox