I have 4 images.Onclick of each image corresponding div content will be displayed.How i will get triangular pointer on image when the image is clicked.
by using css i got the triangular image
#img {
width: 150px;
height: 40px;
background-color: darkblue;
position: relative;
margin-left: 40px;
border-radius: 5px;
}
#img:before {
content: '';
position: absolute;
left: 42%;
top: 100%;
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid darkblue;
clear: both;
}
<img src="smiley.gif" alt="Smiley face" height="42" id="img" width="42">
How i will get the triangular pointer on the button click