I’m looking to define a variable:
var alumniName = // id from a list ( example: <li id="JoeJohnson">Joe Johnson</li> ).
I want the variable to match what a visitor clicks on.
(example:
<li id="JoeJohnson">Joe Johnson</li>
// when a visitor clicks on the name Joe Johnson... the variable = JoeJohnson
<li id="FredSmith">Fred Smith</li>
// when a visitor clicks on the name Fred Smith... the variable = FredSmith
etc… )
Any help is much appreciated -Thanks-
Try this
HTML:
JavaScript (to be called on body load):