Web Analytics Made Easy -
StatCounter how to get Hyperlink value in js - CodingForum

Announcement

Collapse
No announcement yet.

how to get Hyperlink value in js

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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>

    Comment


    • #3
      its working...
      thnks

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎