I have a report which has id as hyperlink.when i click the
id it should move to next report which displays the
corresponding details.tell me how to get the value of
hyperlink(which id is clicked) dynamically using javascript?
so that i can make condition on my second report?
Answer Posted / abinash grahacharya
<script>
function show(id)
{
var n_id = id+1;
var div = 'div'+n_id;
for(var i=1;i<3;i++ )
{
var n_div = 'div'+i;
document.getElementById(n_div).style.display='none';
}
document.getElementById(div).style.display='block';
}
</script>
<div id='div1'>
<a href='#' onClick='show(1)'>Click 1</a>
Some description of 1st section
</div>
<div id='div2' style='display:none;'>
<a href='#' onClick='show(2)'>Click 2</a>
Some description of 2nd section
</div>
<div id='div3' style='display:none;'>
<a href='#' onClick='show(3)'>Click 3</a>
Some description of 3rd section
</div>
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Why does the browser display the slow script warning?
What is output of “20” + 20 + 20 and “20” + ( 20 + 20)? In javascript?
What e means?
What is Associative Array? How do we use it?
How to disable an html object ?
What are disadvantages of using javascript?
Is JavaScript case sensitive? Give an example?
How can I prevent others from reading/stealing my scripts or images?
How can the os of the client machine be detected?
How many types of functions are there in javascript?
How to create an input box?
Which built-in method calls a function for each element in the array?
How to trigger a postback on an updatepanel from javascript?
How to loop through array in javascript?
How use javascript html?