Jump to content

using onSelect to change div properties


AndyB

Recommended Posts

The thread title says what I wish I could do with both IE and Firefox (and I don't even care about the other browsers).

Full example viewable source at http://www.halfadot.com/temp/pick-colors.html

Basically I want to show selectable foreground/background colours in a specific div. The syntax below sort of works with IE except it declines to show the font size as defined, there are no colour changes with Firefox but the text is shown the right size. The code is pretty trivial ... except it doesn't work. Any javascript/CSS wizards want to point me in the right direction?

[code]select onChange='document.getElementById("testx").style.color = this.value;'[/code]
Link to comment
https://forums.phpfreaks.com/topic/23716-using-onselect-to-change-div-properties/
Share on other sites

Well, the FF problem is simple enough -- your values aren't valid HTML colours, since the lack the leading '#'.  IE will let you get away with just about anything ;-)  Not sure about the font-size issue, I don't see what you're talking about.
i don't see what you mean - they both appear at the same size in my IE and FF.  do you mean the positioning?  i notice FF's text is centered both vertically and horizontally, whereas IE is only horizontally centered.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.