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?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / hanuman prasad
write some function in Onclick="myfunction(Hyperlink)"
like
<a href="#",onclick="myfunction(click1)">click1</a>
in javascrpt function u can decide which is the hyper lick
uer presently clicked on..
Cheersssssssss
| Is This Answer Correct ? | 2 Yes | 2 No |
Is Javascript a Functional Programming Language?
How do I turn on javascript in google chrome?
What is a name function in javascript & how to define it?
a code in vb script, which creates a table of 5*2 in html this is a static table, one more same dynamic table, as we give input the table should get created.
What Is The Disadvantages Using InnerHTML In JavaScript?
What are the predefined functions in javascript?
What is a Typed Language?
How to embed javascript in a web page?
20 Functions of Selenium with description and Examples.
What is viewstate in javascript?
How do you access an element in an HTML document with JavaScript?
Can you tell me how to send email using javascript?