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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to get Hyperlink value in js

    hai....

    this is my code:

    <a id="idname" onclick="show('idname')">34</a>

    in javascript
    function show(){
    }

    Here how can i get that number 34?
    please Help me

    Thanks in advance

  • #2
    Regular Coder
    Join Date
    Mar 2011
    Posts
    148
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Hy,
    Try this function:
    Code:
    <a id="idname" onclick="show('idname')">34</a>
    <script type="text/javascript">
    function show(id){
      var aval = document.getElementById(id).innerHTML;
      alert(aval);
      return false;
    }
    </script>

  • #3
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    its working...
    thnks


  •  

    Posting Permissions

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