javascript - How to incorporate the img and data attributes -
i have
<img src="http://www.lab..whatever/<? echo <span id="accntvisaphotopath"></span>";?>" height="50" width="50">
i have info (dynamically)
and have script
<script> $(function(){ $('select').change(function(){ var selected = $(this).find('option:selected'); $('#visanumber').html(selected.data('visanumber')); $('#idnumber').html(selected.data('idnumber')); $('#statusapp').html(selected.data('statusapp')); $('#accntvisaphotopath').html(selected.data('accntvisaphotopath')); $('#passportpath').html(selected.data('passportpath')); }).change(); }); </script>
what wrong img
line?
you trying add together span tag attribute of img tag. wrong img line. should echo span after img tag closed or echo else not span tag.
i guess want alter img src attribute dynamically, in case should give id img , alter src attribute javascript.
javascript jquery html
No comments:
Post a Comment