473,406 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

document.createElement .......

Hi guys,
I was wondering how we can use document.createElement() in javascript program to create an object of javascript, which will further refers to a jpg image.
any help is appreciable.
Thanks
Aug 25 '11 #1
1 1761
Dormilich
8,658 Expert Mod 8TB
you create with that function an HTML <img> element, assign the image location to the src property and attach this object to the DOM tree.
Aug 25 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Weston C | last post by:
After noticing some problems with a script, I tried testing various bits in the squarefree javascript shell ( http://www.squarefree.com/shell/shell.html ) and noticed this: var anchor =...
4
by: oeyvind toft | last post by:
How do I create a checkbox element ? Or any other input type ? document.createElement('checkbox') doesnt seem to work. Oeyvind -- http://home.online.no/~oeyvtoft/ToftWeb/
2
by: Dave | last post by:
I have a page which uses JavaScript to create form elements using document.createElement('input'), etc.. Both Firefox and IE have no problem accomplishing this and when the form is submitted all...
2
by: rain_c1 | last post by:
Hi! I have problems with document.createElement() in IE when using TR tags. Please look at the following very short example: ------------snip----------------- <table id="test"></table> ...
7
by: bayfaulkscatering | last post by:
I'm definitely not new to JS, but for the life of me, I can't figure this one out. Here's basically what I'm doing: function foo() { alert(this); } span = document.createElement('span'); a...
6
by: raoul | last post by:
MSIE 6.0 apparently does not support protyping with objects created with document.createElement, while Firefox does. I tested it by typing it into the adress bar, but it also appears to be the...
10
by: webEater | last post by:
Hello, I try the following in Firefox and other modern browsers: window.addEventListener('load', function() { document.title = CSS.getClass('fontSize'); var div = document.createElement('div');...
4
by: Narven | last post by:
Hi, I've been creating a script that dynamic loads js files. but after creating that script, (and i use document.createElement('script');) in that function.. i've realise that the code that...
4
by: tswaters | last post by:
Alright, so generally I'm using document.createElement("IMG").... but, I've noticed something just recently that made me switch to "new Image()" What I'm doing is creating a photo gallery of...
23
by: vunet | last post by:
It is recommended by some sources I found to create IFrames in IE using document.createElement('<iframe src="#">') instead of document.createElement('iframe'). Why and what browser versions to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.