Inserting Images into Div Tag

Is there a way to use JQuery to insert images into a div tag?
Here’s what I would like the result to look kike:

<div id=’photos’>
<img alt='' src='Photos/Photo1.png' class='Photos_ImagePos'/>
<img alt='' src='Photos/Photo2.png' class='Photos_ImagePos'/>
<img alt='' src='Photos/Photo3.png' class='Photos_ImagePos'/>
</div>

When I try it the images don't appear???

$("#photos").append("<img alt='' src='Photos/Photos1.png' class='Photos_ImagePos'/>");
Ray TurnerSenior ConsultantAsked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
0
 
GaryCommented:
Your quotes are wrong, should be

<div id='photos'>
0
 
Ishaan RawatDesigner | Developer | ProgrammerCommented:
Actually there should be double quotes in all the areas.. in HTMl..

corrected code...

<div id="photos">
<img alt="" src="Photos/Photo1.png" class="Photos_ImagePos">
<img alt="" src="Photos/Photo2.png" class="Photos_ImagePos">
<img alt="" src="Photos/Photo3.png" class="Photos_ImagePos">
</div>

Open in new window


and then other reason could be you have not linked to jquery..
0
 
GaryConnect With a Mentor Commented:
Single quotes around attributes are totally valid HTML.
http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2
0
 
Ray TurnerSenior ConsultantAuthor Commented:
Thanks!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.