How Javascript Works

I have a JavaScript function SwitchView … greately works with Firefox, but not in the browser …?
the script should hide an item, while showing another … The script is as follows: SwitchView function (a, b) (var element = document.getElementById (a) var = document.getElementById elementB (b) if (elementA.style.display =='') (elementA.style.display = 'none';) else (if elementA.style.display ='';) (elementB.style.display =='') (ElementB.style.display = 'none';) else (elementB.style.display function ='';)) is called in the The HTML code follows: dashed # 000000; margin-left: 15px; margin-left! Explorer: 0px; 'onclick =' javascript: SwitchView ( "Test ", "testoEdit ");'> (on a PHP page) Why not work with Firefox and the browser??? Can anyone help? Thank you!
there may be some error with javascript UR. to show the div, use elementA.style.display = 'block', however, Use or elementA.style.visibility = 'hidden' & elementA.style.visibility = "visible", both work with IE.
How JavaScript Works