dominod Posted October 4, 2010 Share Posted October 4, 2010 Hi, I am a javascript newbie and wonders how to do this: I want to change this: .buttons a, .buttons button{ background-color:#f5f5f5; to this .buttons a, .buttons button{ background-color:#000000; when enter is clicked when the form field is focued (to make it behave like a button). Anyone knows how to do this? This is the code for the button BTW: <div class="buttons"> <a href="#" onclick="this.blur();parent.document.forms[0].submit();">Search </a></div></form> Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 4, 2010 Share Posted October 4, 2010 I'm not sure I understand. You state you want to change a form field when it has focus, but there is no form field in your code. Plus, I'm not sure what you mean about "when enter is clicked...". Are you taking about the user CLICKING something on the page or when the user PRESSES the Enter key on the keyboard? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.