473,405 Members | 2,185 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,405 software developers and data experts.

<UL> and onClick in non-text area of <LI> item

OK, I am utterly stumped. The code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
ul {
background-color: red;
}
</head>
</style>
<body>
<table>
<tr>
<td></td> <!-- remove this line and below works?!?! -->
<td>
<ul style="cursor: wait;" onClick="alert('got ya!')">
<li>data</li>
<li>stuff</li>
<li>some more data goes here</li>
</ul>
</td>
</tr>
</table>
</body>
</html>

With the code above, you MUST click on the text in the <UL> list in order to
trigger the onClick() code. If you take out the commented line above (the
<td></td> above) you can then click on any of the red area to trigger the
onClick() code. In the first case you must click on the text. In the second
case, you can click anywhere within the bounds of the <LI> (which is what I
want). WHY?!?!

Both IE 6 and NN7 display the same behaviour. If anyone can explain this I'd
be most grateful. I've beat my head against a wall now for hours and need
help.

ta
-randall
Jul 20 '05 #1
1 3652
Randall Sell wrote:
OK, I am utterly stumped. The code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
ul {
background-color: red;
}
</head>
</style>


misplaced closing style tag, resulting in error; use

</style>
</head>

Fix that. Retry. Note that a validator can help you spot mis-nested
elements and other syntax errors.

http://validator.w3.org/

If you still have problems after that, please put up an online test
and give us the url. (It is much easier to check out an online
example than to starte at code in a post.)

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

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

Similar topics

4
by: Anshul Gupta | last post by:
Hi, Is there a way i can just print a designated area out of the whole asp(or html) page using javascript or vbscript. i want to mark out the beginning and the end on the page and create a link...
2
by: WindAndWaves | last post by:
Hi Folk I have an image map (map of New Zealand with various areas defined using an image map). Now I am wondering if it is possible to link this "image map" to an onclick and onmouseover...
4
by: masantha wee | last post by:
Hi all, I am using Firefox and embedding Javascript in html. I understand that we can use mouse events by coding them in the body of html (by creating a button or anything and by adding in the...
6
by: j_liu21 | last post by:
I'm trying to trigger a javascript call when someone clicks on an image. <a href="javascript:void(0)" onClick="alert('hi');"><IMG src="foo.gif" usemap="#someImageMap" border="0"></a> This...
0
by: Diane Yocom | last post by:
I'm very new to ASP.Net and probably jumped in a little over my head, but... I'm trying to create a user control that will control navigation through my site. It's sortof like Amazon.com, where...
7
by: news.east.cox.net | last post by:
Hello, I'm trying to figure out why the following code won't work for me. The Firefox javascript console tells me that tableItemClicked is not defined, but the function is right there in the...
1
by: timmehtong | last post by:
Can someone help me on this. I got part of it done but i need help on the last part. What I'm trying to do is make the pictures from the smaller size go bigger and take up the given table area and...
8
by: Dan Rumney | last post by:
All, I have a web page (copied below) with 3 images on it of fixed dimensions. Each image has a map associated with it In the maps, there are a number of areas with an onClick handler...
1
by: xdevel1999 | last post by:
Hi why if I have a DIV I can raise an onclick event only on the inner DIVs and not on the whole area? (Firefox does it) <div id="submenu" class="style1"> <div id="item" onclick="alert(444)">...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.