Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pass value in HREF

    Hello all,

    In an JavaScript function, I am getting some value into a variable called procid.

    Down the page, I have this link <a href="/abc/xyz.htm">

    I would like to pass the value of this variable procid as an parameter in the href...so it would look like

    <a href="/abc/xyz.htm?procid=1234"> where 1234 is the actual value from the function.

    Thanks a lot,

    NRastogi

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <a href="#" onclick="location.href = '/abc/xyz.htm?procid=' + myFunction(); return false;">
    Hope that helps!

    Happy coding!

  • #3
    Super Moderator sage45's Avatar
    Join Date
    May 2002
    Posts
    1,064
    Thanks
    0
    Thanked 15 Times in 15 Posts
    Also you can use this resource if you have any further questions...

    http://www.javascriptkit.com/javatutors/send1.shtml

    -sage-
    HTML & CSS Forum Moderator

    "If you don't know what you think you know, then what do you know."
    R.I.P. Derrick Thomas #58
    1/1/1967 - 2/8/2000

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much guys...

    Regards, NRAstogi


  •  

    Posting Permissions

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