I would like to ask if there is a more elegant way to insert images to html with javascript without jQuery than:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title></title> </head> <body> <script> for(i = 0; i < 3; i++) { name = i + "_img"; document.write("<img name=" + name + " />"); img = document.images[name]; img.src = i + ".png"; } </script> </body> </html> Eventually I am gonna have there much more atributes and I want to avoid using < img /> as much as possible to make it more transparent.