Use the result of a JQuery call to display an image based on the result name - Javascript jQuery

Javascript examples for jQuery:Image

Description

Use the result of a JQuery call to display an image based on the result name

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//  w w w  .j  a v a 2s  . com
var output = 'http://www.java2s.com/style/download.png';
$('body').append(
    $('<img />', {src: output, alt: ''})
);
    });

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials