By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,594 Members | 3,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,594 IT Pros & Developers. It's quick & easy.

Javascript Functions

P: 7
Hi Guys, the problem im having is constructing a function that is usable for any submit button if it meets a certain criteria (this case mouseOver). Now orginally I was using the submit button for only one and was working fine but there are three. So I would like to make a javascript function that allows them to change color individually and not all at the same time.

Thanks for the help in advance, Regards X =)

Expand|Select|Wrap|Line Numbers
  1. <input value="1" onMouseOver="submitOver()" type="submit" name="input_submit">
  2. <input value="2" onMouseOver="submitOver()" type="submit" name="input_submit">
  3. <input value="3" onMouseOver="submitOver()" type="submit" name="input_submit">
  4. function mouseOver() {
  5. document.getElementById("input_submit").style.color = "#00FF00";
  6.  
Jan 4 '08 #1
Share this Question
Share on Google+
2 Replies


P: 7
sorry wrong code just fixed it up there:

Expand|Select|Wrap|Line Numbers
  1. <input value="1" onMouseOver="mouseOver()" type="submit" name="input_submit">
  2. <input value="2" onMouseOver="mouseOver()" type="submit" name="input_submit">
  3. <input value="3" onMouseOver="mouseOver()" type="submit" name="input_submit">
  4. function mouseOver() {
  5. document.getElementById("input_submit").style.color = "#00FF00";
  6. }
  7.  
Jan 4 '08 #2

P: 7
Thanks anyways guys, problem been solved/ =)
Jan 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.