I am currently working for a survey project. I have seen image questions in some surveys.
i want to implement it in my project. so i have thought like this.
here is my code.
<div id="image1" onclick="Imagecheckbox(this);">
<img src="https://www.google.co.in/images/srpr/logo3w.png" alt="Image not found" />
</div>
<div id="image2" onclick="Imagecheckbox(this);">
<img src="https://www.google.co.in/images/srpr/logo3w.png" alt="Image not found" />
</div>
<div id="image3" onclick="Imagecheckbox(this);">
<img src="https://www.google.co.in/images/srpr/logo3w.png" alt="Image not found" />
</div>
so when i click on any image i want to show some thing like this.

so i am creating a div dynamically and appending to this. but its not working.
here is my code.
function Imagecheckbox(div) {
var clickeddiv = $('#' + div.id);
$("<div id='mydiv' style='background:yellow;z-index:1;height:100;width:100;align:right;vertical-align:bottom;etc...'></div>").appendTo($(clickeddiv));
}
How can i do this ?
thanks.
First of all, avoid the use of
onclickattributes. If you already have included jQuery on your page, you may as well make best use of it.To achieve this you need to add
position: relative;to yourdivelements which contain the images, andposition: absoluteto thedivwhich contains the ticks.HTML
jQuery
CSS