[Javascript] Arrays + Tooltip

Hakan M (Backbase) hakan at backbase.com
Thu Jan 20 07:48:15 CST 2005


Try this:

topArray[0] = new Option('<nobr title="'+titleInfo+'">Title 
Info</nobr>', "");

You should probably use topArray[i] instead of topArray[0], too?

Regards,
H

Gonella Jayprakash wrote:
> 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
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list