I\'m implementing as simple image gallery.
This is what I got for now
function init(){
var elem = document.createElement(\"img\");
elem.scr=\'upload
you have a typo in your code:
elem.src='upload/creative-design-modern-furniture.jpg';
// ^---- was 'scr' in your code
You have a typo when you're setting the source. Instead of elem.scr
it should be elem.src
.
You have probably made a typo, using scr="..." instead of src="....".
I highly suggest that you use some element inspectors in browsers such as firebug (Mozilla Firefox), DragonFly (Opera) or Chrome built-in tool to check how the code is finally formed in the page when loaded and easily locate those types of errors. They are easy to use, they allow you to test and make such modifications in html/js/css on-the-fly and they can save you a lot of time.
You have made typo
elem.scr='upload/creative-design-modern-furniture.jpg';
should be
elem.src='upload/creative-design-modern-furniture.jpg';