SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Threaded View
-
Apr 29, 2002, 05:55 #1
reducing innerHTML > function set
In my current folio site I have used IDed spans with the innerHTML command to alter descriptions of folio items.
I have 3 text strings that are all changed: Title, Dimensions and Description.
The spans are called worktitle, dimensions and about, respectively.
Each button in the section sub-menu has the following set of commands (with varying texts):
onclick="worktitle.innerHTML='title blah blah'; dimensions.innerHTML='dimensions blah blah'; about.innerHTML='description blah blah';"
I would like to be able to use functions instead and turn the set into something like:
onclick="textOne('title blah blah'); textTwo('dimensions blah blah'); textThree('new description blah blah.');"
...or ideally, turn the set into one function that can refer to and change all three texts. Something like:
onclick="textWrite('title blah blah', 'dimensions blah blah', 'description blah blah')"
My absolute beginner's knowledge of javascript is still insufficient to do this without help.
Anyone here want to to show me how it's done?
Thanks in advanceLast edited by Bill Posters; Apr 29, 2002 at 06:04.
New Plastic Arts: Visual Communication | DesignateOnline
Mate went to NY and all he got me was this lousy signature
Bookmarks