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

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -