[jQuery] [Newbie] dynamic text loads...

[jQuery] [Newbie] dynamic text loads...


I have some data in an js associative array:
texts = new Array;
texts.webmail = "Go directly to Web e-mail.  The easy way to read and write e-mail when you are away from home.";
texts.dsl ="Complete information on the DSL service.";
texts.members = "Member information and downloads."
My document has this unordered list:
<ul id="links">
    <li>
        <a id="dsl" href="#">DSL High Speed Service</a>
    </li>
    <li>
        <a id="members" href="#">Member Services</a>
    </li>
        <li>
        <a id="webmail" href="#">Web-Mail</a>
    </li>
</ul>
<div id="boxtext">
Boxtext.
</div>
what I try to do is put a hover for each link, with the particular text.
And this works just fine:
    $("a[@id=dsl]").hover(function(){
          $("#boxtext").html(texts.dsl);
          }
but I would like to avoid writing this three times, with only the id=string and the texts[string] changing.
Is there a way to get this solved dynamically?
I thinking some kind of loop somehow, I am not quite getting it..I am syntactically challenged...
Any hints would be highly appreciated.
Birgit
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/