bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

div does not have properties

VERIFIED INVALID

Status

()

Core
DOM: Core & HTML
VERIFIED INVALID
17 years ago
10 years ago

People

(Reporter: Martin Stumpf, Assigned: jst)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
The following Example does not work bekause div does not have properties.
See also Example 6 at http://developer.netscape.com/viewsource/angus_css.html

<HTML>
  <HEAD>
    <STYLE TYPE="text/css">
      #mozilla {position: absolute; left: 100; top: 100;}
    </STYLE>
  </HEAD>
  <BODY >
    <DIV ID="mozilla">I am slip, sliding away...</DIV>
    <form>
      <input type=button value=Move onClick='document.mozilla.left+=10'>
    </form>
  </BODY>
</HTML>

Comment 1

17 years ago
The page you are referring to is a document for Netscape 4 only. In Mozilla/NS6
you have to use "document.getElementById("mozilla"). This is the standard
behavior defined by the W3C.
Marking INVALID.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID

Comment 2

17 years ago
Your javascript is incorrect (it's a NS4 "layers" proprietary DOM).
The following works for both NS4 , IE5 and Moz

<HTML>
<HEAD>
<STYLE TYPE="text/css">
#mozilla {position: absolute; left: 100px; top: 100px;}
</STYLE>
<script type="text/javascript">
var mozLeftPos=100;
</script>
</HEAD>
<script type="text/javascript">
var leftPos=100;
function slide() {
  leftPos+=10;
  if (document.layers) document.mozilla.left=leftPos;
  else document.getElementById("mozilla").style.left=leftPos+"px";
}
</script>
<BODY >
<DIV ID="mozilla">I am slip, sliding away...</DIV>
<form>
<input type=button value=Move onClick='slide()'>
</form>
</BODY>
</HTML>

Note also that your style sheet is not correct though accepted. It should be:
 #mozilla {position: absolute; left: 100px; top: 100px;}


Should be marked INVALID.

Comment 3

17 years ago
Actually, my example is a little bit messed due to 
bad cut and paste. But the idea is there.

Comment 4

17 years ago
verified invalid
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.