Closed Bug 280641 Opened 20 years ago Closed 20 years ago

inline javascript (i.e. onClick) does not work if xhtml DOCTYPE defined

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: asidorov, Assigned: bugzilla)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

If the first line removed, menu is working.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Table of Contents</title>

<style type="text/css">
body {background-color: #ffffff}
.headings { font-size:24px; font-weight:bold; cursor: pointer}
.subheadings {padding-left: 12px}
</style>

<script language="JavaScript" type="text/javascript">
<!--
//
function displaySubs(subNum){
//display the section if hidden; hide it if displayed
	if (subNum.style.display=="none") {
		subNum.style.display=""
	} else {
		subNum.style.display="none"
	}
}
//-->
</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>

<p><span class="headings" onclick="displaySubs(sub1)" style="color:
green">Certification</span></p>
<div class="subheadings" id="sub1" style="display: none; color: blue">
	CIW<br />
	Foundations<br />
	Designer<br />
</div>

<p><span class="headings" onclick="displaySubs(sub2)" style="color:
brown">Training</span></p>
<div class="subheadings" id="sub2" style="display: none; color: blue">
	Internet<br />
	Intranet<br />
	e-Commerce<br />
</div>

<p><span class="headings" onclick="displaySubs(sub3)" style="color: red">Job
Roles</span></p>
<div class="subheadings" id="sub3" style="display: none; color: blue">
	Designer<br />
	Developer<br />
	Administrator<br />
</div>

</body>
</html>



Reproducible: Always

Steps to Reproduce:
1. Open the file in Firefox

Actual Results:  
Menu does not work

Expected Results:  
Menu should work
See bug 256932: elements are reflected into the global scope in quirks mode
only. The DOCTYPE triggers strict mode.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Summary: inline javascript (i.e. onClick) does not work if xhtml DOCTYPE defined → inline javascript (i.e. onClick) does not work if xhtml DOCTYPE defined
You need to log in before you can comment on or make changes to this bug.