How to Improve this if else structure in Javascript?

Posted by basit74 on Stack Overflow See other posts from Stack Overflow or by basit74
Published on 2010-05-14T10:19:06Z Indexed on 2010/05/14 10:24 UTC
Read the original article Hit count: 151

Filed under:
if(isIE())
 if(termin != "") 
   TargetElement.onclick = function() {merkzettelRemove(this, id, termin)};     
 else
  TargetElement.onclick = function() {merkzettelRemove(this, id)};
                                                         else       
  if(termin != "")      
    TargetElement.setAttribute("onclick","merkzettelRemove(this, " + id + ",
       '" + termin + "')");
  else
   TargetElement.setAttribute("onclick","merkzettelRemove(this, " + id + ")");

© Stack Overflow or respective owner

Related posts about JavaScript