title: Not able to display div with style.display='block';
body: <p>Not able to display div with <code>style.display='block';</code><br>
  i have a jsp with style as display : none
  i want to set display as block in javascript
  i have written below code but its not working
  also i have tried to set display in document.ready
  strangely it was working but after refreshing page 2 3 times.
  result here is loaded by making ajax call.</p>
  
  <p>jsp code: </p>
  
  <pre><code>&lt;c:set var="projVar" value="ssc-portal-2.0.3.x"/&gt;
  &lt;div style="display: none;" id="&lt;c:out value="${projVar}"/&gt;"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>// result is : ssc-portal-2.0.3.x@/P_ssc@@SSC00004951@/P_ssc(WI-  1409);,
  function populateActivityInfo(result) {
  
      var resultProjArr = result.split(',');
      var tempProjName = '';
      var activityList = '';
      var tempProj = '';
      for (var i = 0; i &lt; resultProjArr.length; i++) {
          if (trim(resultProjArr[i]) != '') {;
              tempProjName = resultProjArr[i].split('@@')[0];
              activityList = resultProjArr[i].split('@@')[1];
              tempProj = trim(tempProjName.split('@')[0]);
              //here tempProj is ssc-portal-2.0.3.x
              document.getElementById(tempProj).style.display = 'block';
          }
      }
  }
  </code></pre>