title: How to Get particular child node class name using javascript?
body: <p>I want to get particular child node(i.e. class name). how can i do this. This is my code</p>
  
  <pre><code>    &lt;div id="mess"&gt;
                       &lt;h1&gt;Bhashyam School&lt;/h1&gt;
                          &lt;p&gt;AC Nagar Main Road, Nellore &lt;br/&gt;Ho, Nellore - 524001  &lt;/p&gt;
                       &lt;p class="tel"&gt;Telephone: +(91)-9603444376 &lt;/p&gt;
                       &lt;p class="email"&gt;Email: &lt;a href="mailto:info@citydeal.in"&gt;info@citydeal.in&lt;/a&gt;&lt;/p&gt;
                       &lt;p class="web"&gt;Website: &lt;a href="http//citydeal.in" target="new"&gt;http//citydeal.in&lt;/a&gt;&lt;/p&gt;
                       &lt;p class="description"&gt;Hours of Operation : 
                          Monday, Tuesday, Wednesday, Thursday, Friday, Saturday: 09:30 am to 10:00 pm&lt;br&gt;
                          Sunday: Closed , Modes of Payment : 
                          Cash
                       &lt;/p&gt;
  
  &lt;form name="contactform" method="post" action="send.php" onsubmit="return getChilds();"&gt;
                      &lt;p&gt;
                          &lt;input id="box" type="text" name="telephone" placeholder="Enter Mobile Number"/&gt;
  
                          &lt;input type="hidden" name="strToSend" id="strToSend"/&gt;
                          &lt;button type="submit" class="button" value="Submit"&gt;Get SMS&lt;/button&gt;
                      &lt;/p&gt;
                  &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;script type="text/javascript"&gt;
          function getChilds()
      {
          var arr=document.getElementById('mess').childNodes, str='';
          for(var i=0; i&lt;arr.length; i++) {
              if(arr[i].innerHTML!=undefined) {
                  str+=" "+(arr[i].textContent||arr[i].innerText);
              }
          }
          document.getElementById("strToSend").value=str;
          return true;
      }
      &lt;/script&gt;
  </code></pre>
  
  <p>In the above javascript code i want childNodes with particular class names (ex:p class="tel", p class="email").</p>