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



I have a report which has id as hyperlink.when i click the id it should move to next report which ..

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

I have a report which has id as hyperlink.when i click the id it should move to next report which ..

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

Post New Answer

More JavaScript Interview Questions

What's math constants and functions using javascript?

0 Answers  


Do unused imports affect performance javascript?

0 Answers  


What is question mark in javascript?

0 Answers  


What is the best site to learn javascript?

0 Answers  


List some design patterns in javascript?

0 Answers  






How to getting values from cookies to set widgets?

0 Answers  


How to get height and width of different browser in Javascript?

0 Answers  


What does question mark mean in react?

0 Answers  


how to run the servlet in tomcat

0 Answers   DELL, TCS,


java pgme for class members hours:minutes:seconds then the constructor expects milliseconds as assignment and initialize data members the members function print hh:mm:ss 90,000 milliseconds passed in constructor then the output is 00:01:30

0 Answers  


Explain about session? Where it runs & what are different types of session handling?

1 Answers  


Explain typecasting in javascript?

0 Answers  


Categories