Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. xryancat

    Change visibility of elements

    I figured out, I just changed the variable name, it now reads: function show( i ) { i.style.display = 'block'; } But that doesn't seem to work either. . . No errors are returned, but the element's display isn't changed.
  2. xryancat

    Change visibility of elements

    It returns this error: Error: missing formal parameter Source Code: function show(this) The function show() is this: function show (this) { var list = document.this.style.display = 'block'; } I'm thinking I just made another stupid mistake?
  3. xryancat

    Change visibility of elements

    You are soo helpful!! :-D Thanks, mate! Everything is working great. Except the show function needs to know what specific element was clicked, and then do something to only that element. How would I go about doing that? Thanks again!
  4. xryancat

    Change visibility of elements

    :-D Thank you! That worked perfectly! Now, what would be the simplest way to start a function every time one of the <li> tags is clicked. var x = document.getElementById("options").getElementsByTagName('li'); for (var i=0;i<x.length;i++) x[i].onClick = show(); That automatically initiates...
  5. xryancat

    Change visibility of elements

    I know how to toggle the display and everything, the only thing I can't grasp is the most simple way to hide the others when they aren't visible. document.getElementsByTagName("li").display.style = "none"; Shouldn't it be something like that?
  6. xryancat

    Change visibility of elements

    My html is like this <ul id="menu1"> <li> <span>Edit</span> <div style="display: hidden;"> Edit the Info </div> </li> <li> <span>Delete</span> <div style="display: hidden;"> Delete the Info </div> </li> </ul> Whenever someone...

Part and Inventory Search

Back
Top