...

View Full Version : how to get Hyperlink value in js



rpoorella
08-22-2011, 08:00 AM
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

MarPlo
08-22-2011, 08:22 AM
Hy,
Try this function:


<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>

rpoorella
08-22-2011, 08:28 AM
its working...
thnks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum