I have a code that receives the value drop-down list and displays a picture, the path of which is specified in the value each item in the list. Now it became necessary to display another html document, and it wasn’t easy to replace <img> with <iframe> . Members, help please. JS is weak for now. Here is the code that I use to display the image.
<img id="img" src="value" align="middle" /> <script> var select = document.getElementById('categories'), img = document.getElementById('img'); select.addEventListener('change', changeImg.bind(this),false) function changeImg(elem) { img.src = elem.target.value } </script>
imgtoiframe, no problems, what's the problem? - KRasul