i'm novice to this and can anybody say how to change CSS properties with javascript functions?
how can i change font-sizes/font styles using a combobox represented in a textarea?
[img]http://i.imgur.com/KH0om.jpg[/img]
if you can show me how events working..thank you
divsok 0 Newbie Poster
Recommended Answers
Jump to Post<!doctype native> <html> <head> </head> <body> Font Size: <select id=fontSize> <option>10pt</option> <option>12pt</option> <option>14pt</option> </select> Font Family: <select id=fontFamily> <option>Arial</option> <option>Verdana</option> <option>Georgia</option> </select> <div id=myDiv> some div </div> <textarea id=myTextArea> some text content </textarea> <script> fontSize.onchange=fontFamily.onchange=setTarget; setTarget=[myDiv,myTextArea/*etc*/]; function setTarget(x){ for(x in setTarget) setTarget[x].style[this.id] = this.value; } </script> </body> …
Jump to Postyou are not meant "to see CSS" and the wrong is your lack of copy-paste skill probably [!]
the code works perfectly in all browsers including the ones that are to be invented in the future.
and
what do you mean "events are not working as you've coded"? how "else" …
All 7 Replies

stbuchok
suhaildawood 0 Newbie Poster
Troy III 272 Posting Pro
divsok 0 Newbie Poster
Troy III 272 Posting Pro
divsok 0 Newbie Poster
Troy III 272 Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.