title: JQuery Append if condition
body: <p>Could you please help on how to add if condition to the below snippet?</p>
  
  <p>Snippet:</p>
  
  <pre><code>function ServiceSucceeded(result) {
  $('#accNo12').empty();
  if (DataType == "json") {
  $('#accNo12').append("&lt;div id=\"Search\" class=\"results\"&gt;"+
  "&lt;span id=\"lb\"&gt;Account No:"+result.U_ID+"&lt;/span&gt;&lt;/div&gt;"+
  "&lt;label&gt;RelMgr: &lt;/label&gt;"+
  "&lt;span id=\"RID\"&gt;"+result.REL_NAME +"&lt;/span&gt;&lt;br /&gt;"+
    "&lt;label&gt;Off ID: &lt;/label&gt;&lt;span id=\"OffId\"&gt;"+ result.SO+"&lt;/span&gt;&lt;br/&gt;");
         }
  }
  </code></pre>
  
  <p>how do i add an if condition to the above snippet in the case where i needed a condition as</p>
  
  <pre><code>if(result.SO==""){
  &lt;label&gt;Off ID: &lt;/label&gt;&lt;span id=\"OffId\"&gt;"+ result.SO+"&lt;/span&gt;&lt;br/&gt;"
  }
  else
  {
   &lt;label&gt;Off ID: &lt;/label&gt;&lt;span id=\"OffId\"&gt;No ID found&lt;/span&gt;&lt;br/&gt;"
  }
  </code></pre>
  
  <p>Appreciate if you could help</p>
  
  <p>Thanks</p>