[Javascript] Arrays + Tooltip

Gonella Jayprakash gonella at mahindrabt.com
Thu Jan 20 06:42:24 CST 2005


Hi,
         I am implementing tooltip in our application. When the user points the cursor to each option in a dynamically populated select box, there should be a tooltip displayed which contians information regarding the option. Technologies are java, jsp and javascript.

In the script, I am fetching each option which is dynamic and populating an array in the following fashion:

<script>
topArray = new Array();
for(i=0; i<size; i++)
{   
    titleInfo =  //some dynamic values
    topArray[0] = new Option('<nobr title=titleInfo>Title Info</nobr>', "");
}
</script>

In the  for loop, in each iteration there will be a dynamic value populated in the variable titleInfo. I have to pass the titleInfo variable to the <nobr title=??>Title Info</nobr>
The above usage is giving a javascript error.

The point to be noted is that if I am passing hard coded value to the nobr title, the tooltip is displaying correctly.

for example: <nobr title="Title 3"> InsideDHTML</nobr>

In the above example, the tooltip displays "Title 3" which is correct

Can anybody please tell how should I pass the variable titleInfo to the <nobr> tag.

Thanks & Regards,
Jayprakash


*********************************************************
Disclaimer:         

This message (including any attachments) contains
confidential information intended for a specific
individual and purpose, and is protected by law.
If you are not the intended recipient, you should
delete this message and are hereby notified that
any disclosure, copying, or distribution of this
message, or the taking of any action based on it,
is strictly prohibited.

*********************************************************
Visit us at http://www.mahindrabt.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050120/f23203fc/attachment.htm>


More information about the Javascript mailing list