Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Harsha Jay
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried it?
 
Harsha Jay
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that it may not work in all browsers.
 
Harsha Jay
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our tech stack dictates IE 7.0 I'm covered. I love firefox though.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It also appears to work in Firefox but not Opera or Safari, which is not surprising as it is non-standard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic