variable outside of a function

1 posts, 0 answers
  1. rahi
    rahi avatar
    1 posts
    Member since:
    May 2011

    Posted 10 May 2011 Link to this post


    I am having a little trouble displaying a variable that's created in a function. I am using an onclick to pass a value from 1-4 depending on the link clicked. I have made the function check to see if the value is 1-4 then created 4 variations of the same variable. So:

    I want to be able to output the value of para anywhere I choose in my html. At the moment I am trying to output the variable in a div using document.write. I have set the variable para outside of the function to make it global, but it still does not work. I know the variable is working inside the function as i have tested it with alert to make sure I'm getting the right value.

    any help on this would be great :)

    Cheers _____________________ [url=]Sightline Payments Kirk Sanford[/url]

Back to Top