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
What is the use of javascript?
What are the advantages of using JavaScript?
What are the five data types?
What is hoisting in javascript?
What does parse Query String return in javascript?
Where javascript variables are stored?
What's the purpose of javascript?
How to read elements of an array in JavaScript?
How do I start a javascript project?
What is foreach loop in javascript?
Are there any training Institutions on iphone Automation testing?
Why is javascript dangerous?
How to handle exceptions in JavaScript?
What is an asynchronous programming? Why is it important in javascript?
What applications use javascript?