SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Dec 2001
    0 Post(s)
    0 Thread(s)

    Input onFocus with a global script

    I really like the effect of using onBlur and onFocus for text-fields, and onMouseover and onMouseout, like so:
     <label for="email">Email Address:</label><input class="form-text" id="email" name="email" onfocus="'#ccc';" onblur="'#E8E8E8';" /><br />
     <p class="center"><input class="button" type="submit" value="Submit Information" onmouseover="'#ccc';" onmouseout="'#E8E8E8';" /></p>
    See it live on (

    In fact, I like it so much that I want that effect for every input on my site. Problem is the CMS can't be edited to include this in every input tag. Is there a JS I can include that will take every input and add the onFocus/onBlur if it is class "form-text", and onmousever/onmouseout for class "button">

    If that isn't possible, what about just the onFocus/onBlur for all inputs?

    I don't really know JS, but it seems to me that this should be possible. 30 minutes of SitePoint and Google searching hasn't turned up anything, so perhaps it's not.

    Any help would be appreciated.

    Last edited by CameronCorda; Jan 5, 2004 at 05:07.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts