php - Image no longer displays when adding 'id' attribute to image tag -
i have grid of images generated on page php. html each image:
echo "<img src= '$link[image_link] . /133x100' title='$row[item_name]' alt='$just_name' onclick='addvalue(". $credit_value .")' border=0 style='position: relative; top: 0; left: 0;'/>" this id:
echo "<id='img1' img src= '$link[image_link] . /133x100' title='$row[item_name]' alt='$just_name' onclick='addvalue(". $credit_value .")' border=0 style='position: relative; top: 0; left: 0;'/>" the src, title, alt, etc attributes being correctly set.
if try add kind of id, example: <id="img" src=.... seems break html code , image no longer appear.
why happening? need images have id can use them jquery functions.
you can try this
<div id="myid"> <img src="http://placehold.it/400x300" id="myimgid"> </div>
Comments
Post a Comment