Reputation: 4982
<img id="lotImgtemp" src="" height="148px" width="200px" border="0">
var photonames=$("#loyaltymemPhoto").val(); //1.jpg
$("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/'+ photonames +'");
How to add the value to img src ?
output i get the same "localhost/sumerdia/uploaded_photos/'+ photonames +'"
output i need is "localhost/sumerdia/uploaded_photos/1.jpg"
Upvotes: 0
Views: 132
Reputation:
Instead of
$("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/'+ photonames +'");
try
$("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/"+ photonames);
Upvotes: 2