Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. how to add image

how to add image

Scheduled Pinned Locked Moved JavaScript
javatoolstutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13904097
    wrote on last edited by
    #1

    hi , jAVA SCRIPT HOW TO ADD IMAGES

    N Z S 3 Replies Last reply
    0
    • U User 13904097

      hi , jAVA SCRIPT HOW TO ADD IMAGES

      N Offline
      N Offline
      Nathan Minier
      wrote on last edited by
      #2

      var img = document.createElement('image');
      img.src = '/blah.jpg';
      document.body.appendChild(img);

      "Never attribute to malice that which can be explained by stupidity." - Hanlon's Razor

      1 Reply Last reply
      0
      • U User 13904097

        hi , jAVA SCRIPT HOW TO ADD IMAGES

        Z Offline
        Z Offline
        ZurdoDev
        wrote on last edited by
        #3

        It appears your keyboard broke. :doh:

        Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.

        1 Reply Last reply
        0
        • U User 13904097

          hi , jAVA SCRIPT HOW TO ADD IMAGES

          S Offline
          S Offline
          Shraddha_Patel
          wrote on last edited by
          #4

          you can try this code

          in JS :- function changingImg(){ document.getElementById("y").src="./images/test2.png" }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups