SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Threaded View

  1. #1
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 advance
    Last edited by Bill Posters; Apr 29, 2002 at 05:04.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •