473,394 Members | 1,702 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,394 software developers and data experts.

Tricky question about referencing div tags, innerHTML, etc....



Below, is it possible to check to see if "somedivtag" exists prior to
running a innerHTML, in a IF ELSE situation?

like
if parent.somedivtag exists then {

document.all["somedivtag'']....

} else {

.....

Dec 2 '06 #1
2 1462
kl*********@gmail.com wrote:
>
Below, is it possible to check to see if "somedivtag" exists prior to
running a innerHTML, in a IF ELSE situation?

like
if parent.somedivtag exists then {

document.all["somedivtag'']....

} else {

....
Yes...

if (document.getElementById("somedivtag")==null)) {
document.writeln('this div doesn't exist');
}

---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA
Dec 2 '06 #2
kl*********@gmail.com wrote:
>
Below, is it possible to check to see if "somedivtag" exists prior to
running a innerHTML, in a IF ELSE situation?

like
if parent.somedivtag exists then {

document.all["somedivtag'']....
if(Element){// do stuff with Element}else{//do something else}

Mick
Dec 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jiing24 | last post by:
I try to use regexp to replace some html tags in DOM, but the result seems some problems, ================================ <Script language="javascript" type="text/javascript"> var config =...
3
by: Nebulus | last post by:
I'm having a really hard time with IE's innerHTML property and <form> tags. If I use this code: myDiv.innerHTML = "<form>This is a test</form>" in fireFox, the div tag shows the content....
2
by: geed_dd | last post by:
Hi I have a piece of code which replaces the contents of a div using innerHTML e.g. this.targetDiv.innerHTML = '<form name="test" id="test1"> in form </form>'; This works fine in IE but...
1
by: WB | last post by:
Hi, I would like to do something like this page: http://www.stocklayouts.com/Products/Postcard/Postcard-Template-Design-Library.aspx?kwid=38 Notice when you mouse-over any of the icons under...
1
by: Edwin | last post by:
I've been Googling & can't find a consistent cross-browser (IE & Firefox) answer to this... I need to pass some data from inside an iframe, to the parent page I've got the parent page...
1
by: darwin2kx | last post by:
I have a problem that I've been tracking down for a while now. I'm working on a script that dynamically adds blocks for data entry to a page. This script works on one page but not another. For some...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
7
by: Osiris | last post by:
Just something I would like to share: I just learned the hard way (2 days detective work on a bug) that foreach loops are not at all like for loops, not intuitive at all. BEWARE: arrays and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.