SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Two functions?

  1. #1
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Two functions?

    A newbie question I have to ask.

    How do you handle two functions? For example:

    if I have two separate scripts, one that opens a popup window onclick and one that does a tool tip onmouseover, how do I tie them together inline, at the link? And i can put them in the same <script> tags in the head, right?
    http://www.soapbox101.com

  2. #2
    SitePoint Zealot jonsteele's Avatar
    Join Date
    Jan 2001
    Location
    Toronto
    Posts
    106
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just put each in its own event handler and they'll do the rest:

    <a href="#" onclick="func1()" onmouseover="func2()">Link</a>

    And yes, scripts can go anywhere, as long as they are in between <script> and </scriipt>, the <script>'s are in the <body> and <head>, and they are written before they are used on the page.

  3. #3
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for clearing this up Jon
    http://www.soapbox101.com


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
  •