Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Jquery variables

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32025
    Arvid
    Member

    Hi everyone! I’m having a problem with jquery right now, what I’m trying to do is to change the value of a variable. I start with this code

    var $myvar = 1;

    and it works fine. But when I’m trying to change this value for some reason it just won’t work.

    var $myvar = 1;
    if ($myvar == 1) {
    var $myvar = 2;
    }

    Could someone please tell me what I am doing wrong? I apreciate any help, thank you!

    #55423
    Arvid
    Member

    Terribly sorry guys, I realised what I was doing wrong, I’ll try to figure out the error for a bit longer before I post a question here next time (although it did take me an hour trying to figure that out :o)

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.