Link to home
Start Free TrialLog in
Avatar of Whing Dela Cruz
Whing Dela CruzFlag for Anguilla

asked on

Html form and modal / img src -problem

Hi experts, I want to show image on the modal where the name of .jpg is coming from outside by way of var declaration. I have declared Var = myPic
myPic = "Sea001" this the name of the image i wanted to show in the modal form.  My codes below won't work. Any help please!

<div id="id02" class="modal" >
  <span onclick="document.getElementById('id02').style.display='none'"
class="close" title="Close Modal">&times;</span>
  <!-- Modal Content 145120000006 -->
  <form class="modal-content animate">
        <div class="imgcontainerE77">  
              <img src="images\" + sea001 + ".jpg" alt="x-men" style="width:400px; height:324px;" on>
        </div>

        <div class="container" style="background-color:#f1f1f1">
              <button type="button" onclick="document.getElementById('id02').style.display='none'" class="cancelbtn">Cancel</button>
        </div>
  </form>
</div>
ASKER CERTIFIED SOLUTION
Avatar of Ishaan Rawat
Ishaan Rawat
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Whing Dela Cruz

ASKER

Thank you Rawat, its working!
Thank for helping me, sir!