I'm trying to expand my knowledge a bit and I've been playing with brython (Python to JavaScript compiler). I'm trying to figure out 2 things and I know this may be strictly a JavaScript and not necessarily bootstrap related question.

What's the right way to bind an event to a nav element? I generate the following fragment based on data gotten from a REST query

HTML Code:
<ul id="vmi_navbar" class="nav nav-sidebar">
<li id="Alex Gibson"><a href="/webapp/name2record?mapID=Alex%20Gibson"><span>Alex Gibson</span></a></li>
<li id="Chris Keating"><a href="/webapp/name2record?mapID=Chris%20Keating"><span>Chris Keating</span></a></li>

What I want, is instead of clicking on the link and going to another webpage, I want to invoke a method/function. FWIW, the method will do another ajax query and fill in a form.

Another thing I would love to figure out is how to query a form and read all the elements so I can inject them back into the system again using an ajax call. I know that's definitely beyond the scope of this form. :-)