javascript - Load image in DIV from url obtained from a TEXT BOX -


i trying t load image div tag url obtained textbox.my current file follows..i don't know else done

<html lang="en">     <head>     </head>     <body>         <input type="text" class="imageurl1">         <div class="imagecontainer">           image appear here:           </div>     </body> </html> 

how using button call funtion that'll change image src url in text box

html

<html lang="en">     <head>     </head>     <body>         <input type="text" class="imageurl1">         <button onclick="func()">load image</button>         <div class="imagecontainer">           <img src="" id="imgcontainer">         </div>     </body> </html> 

javascript

(function(){ var func = function(){  var url = $(".imageurl1").val()  $('#imgcontainer').attr('src',url) }  })(); 

here's jsfiddle with jquery , without jquery


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -