This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes 'title' attribute in Select box in relation to tooltip display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark " Watch " New topic
Author

'title' attribute in Select box in relation to tooltip display

Harsha Jay
Greenhorn

Joined: Sep 25, 2001
Posts: 14
For the snippet below
<select id="something" name="something">
<option value="1">This is option 1</option>
<option value="2">This is option 2</option>
<option value="3">This is option 3</option>
<option value="4">This is option 4</option>
<option value="5">This is option 5</option>
</select>

can I iterate over the <option> elements and is it possible to add 'title' attribute? I am doing this so that I can get tooltips to show up.

Or

Is there a easier way of achieving the tooltip display?

much appreciated!
H
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

What happened when you tried it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Harsha Jay
Greenhorn

Joined: Sep 25, 2001
Posts: 14
Alright got it to work.

I was getting this list from enums.. so, i had to bind it in the JSP.

time well spent!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Be aware that it may not work in all browsers.
Harsha Jay
Greenhorn

Joined: Sep 25, 2001
Posts: 14
Our tech stack dictates IE 7.0 I'm covered. I love firefox though.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

It also appears to work in Firefox but not Opera or Safari, which is not surprising as it is non-standard.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 'title' attribute in Select box in relation to tooltip display
 
Similar Threads
How to add and remove options in dropdown menu?
Need help on right or left shifting Multiple selected options
mouse hover on multiselect dropdown
Only Numeric value allowed
html:option not selected