Cant figure out why my javascript wont run in IE

Discussion in 'JavaScript' started by delux247, Sep 12, 2008.

  1. #1
    Ok so I have a javascript function that will show and hide tables when the "+" and "-" signs are clicked, now the function works fine in firefox but not in IE. IE reported that the last line of the function is the cause of the problem but i cant figure it out. the code is listed below, thanks for any help you can give!
    
    function toggleMonthSection(monthID)
    {
    	//get status (- is shown, + is hidden)
    	mstatdiv = document.getElementById('collapse_'+monthID);
    	mstat = mstatdiv.innerHTML;
    
    	if(mstat == '-')
    	{
    		var mstyle = 'none';
    		var mcol = '+';
    	}
    	else
    	{
    		var mstyle = 'table';
    		var mcol = '-';
    	}
    	mdiv = document.getElementById('table_'+monthID);
    	
    	mstatdiv.innerHTML = mcol;
    	mdiv.style.display = mstyle;
    }
    
    Code (markup):

     
    delux247, Sep 12, 2008 IP
  2. delux247

    delux247 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please delete this thread
     
    delux247, Sep 12, 2008 IP