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

Define closure.

0 Answers  


What is event in web programming?

0 Answers  


How can an HTMLCollection be traversed?

0 Answers  


We are facing problem with the compatibilty of IE 7 and IE 6.We are calling a showModal window that is working fine in IE6 but with IE7 it opens a new Window and Data is not getting poputaled.In some pages it Gives an error "The webpage you are viewing is trying to Close the window.Do you want to close this window".

4 Answers   SAP Labs, TCS,


What is javascript used for on iphone?

0 Answers  






Are Javascript and JScript the same?

0 Answers  


What is JavaScript?

0 Answers  


Can you explain the difference between == and ===?

0 Answers  


What is event target in javascript?

0 Answers  


What is the importance of javascript? Expalin

0 Answers  


Explain how can you submit a form using JavaScript?

0 Answers  


What is noscript tag?

0 Answers  


Categories