Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 24th January 2009, 06:32
CMYK CMYK is offline
Junior Member
 
Join Date: Sep 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default how do I tell javascript what type of data I'm passing to a function?

I have a function that goes like
Code:
function collapse(div) {
    var currentdiv = document.getElementById(div);
    currentdiv.style.zIndex = 3;
}
and code from the html document calls that function like
Code:
<a onclick="collapse('pictures')">pictures</a>
where pictures is the name of a <div> later on that had the id of pictures. Anyway, how can I tell Javascript that I'm passing a string so that the document.getELementById part will work? For example, the code will work if I write in document.getElementById("pictures");.
Reply With Quote
Sponsored Links
 

Bookmarks

Tags
getelementbyid, javascript

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 10:29
Help with Bluetooth PAND josto HOWTO-Related Questions 1 7th August 2007 21:53
2.4.17 system needed modul8r Installation/Configuration 16 31st May 2007 15:15
SuSE Enterprise, PHP binary coming with ISPConfig does not work properly NexusTechUS Installation/Configuration 1 26th April 2007 21:03
Oh crap... Corrupted install TheMJ Installation/Configuration 4 17th February 2006 18:59


All times are GMT +2. The time now is 03:27.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.