Please excuse my ignorance, I have no idea what I'm doing, but I'm trying.
I tried to figure this out by doing a search, but it only gave a functional result in jQuery. Since this is such a small section, I think it would be better to just use plain vanilla JavaScript instead of loading the entire jQuery library.
Does anyone know how / if I can perform the same functions below, but only with normal JavaScript ? Basically, what I'm trying to do is when the "butt1" button is clicked, the unordered list of "links" will become hidden, and the div "box1" will be shown:
<html> <head> <title>qwerty</title> <style type="text/css"> .box1 {background: red;} </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <script type="text/javascript"> $("#butt1").live("click", show_box1); function show_box1(event) { $("#links").css("display", "none"); $(".box1").css("display", "inline"); } </script> </head> <body> <ul id="links"> <li id="butt1"><a href="#">blah</a></li> <li id="butt2"><a href="#">blah</a></li> <li id="butt3"><a href="#">blah</a></li> </ul> <div class="box1" style="display: none;">You clicked butt1!</div> </body> </html>
Here's a link to the above as a working example: http://jsbin.com/umitef/4/ is the functionality I want to replicate.
My big thanks to anyone who for a moment ... :-)
Maurice
source share