function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SubhamSubham 

Open image on click of text

Hi,

 

I want to open a Image when a link is clicked

<ol>

<li>Some text.......... Display Image<li>

<ol>

 I am not sure how to use target attribute in anchor tag.

Display Image should be a link onclick of which i want to display a image.

 

Can you guys provide some input

 

Regards,

 

kumar

 

Best Answer chosen by Admin (Salesforce Developers) 
SFRajSFRaj

<script type="text/javascript">

function showImage(){

   document.getElementById("imageDiv").style.display = "block";

}

</script>

 

<ol>

<li><a href="#" onclick="showImage();">Show Image</a><li>

<ol>

<div style="display:none" id="imageDiv">

    <img src="image.jpg"/>

</div>

 

This is one solution. Hope this will help you.