title: Get Child Node Text in Razor Environment
body: <p>I was wondering how one would be able to get value from child node? I am using razor in the front end and wanted to search everything displayed in the home page. </p>
  
  <p>Razor</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>&lt;li class="media dotted"&gt;
                                              &lt;img class="mr-3" src="~/images/emp-list/mm.png" alt=""&gt;
                                              &lt;div class="media-body d-flex"&gt;
                                                  &lt;div class="text"&gt;
  
                                                      &lt;h5 class="mt-0 mb-1"&gt;@Html.DisplayFor(modelItem =&gt; item.Firstname) @Html.DisplayFor(modelItem =&gt; item.Lastname)&lt;/h5&gt;
                                                      @Html.DisplayFor(modelItem =&gt; item.Title) (&lt;span class="loc"&gt;@Html.DisplayFor(modelItem =&gt; item.Location.LocationCode)&lt;/span&gt;)
                                                  &lt;/div&gt;
                                              &lt;/div&gt;
                                          &lt;/li&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>JS </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function search() {
              var input = document.getElementsByClassName('mt-0');
              var filter = document.getElementById('employeeSearch').value.toUpperCase();
              // Loop through all list items, and hide those who don't match the search query
              for (i = 0; i &lt; input.length; i++) {
                  var currentElem = input[i];
                  var currentElemChild = input[i].children[0];
                  if (currentElemChild.innerHTML.toUpperCase().indexOf(filter) &gt; -1) {
                      currentElem.style.display = "";
                  }
                  else {
                      currentElem.style.display = "none";
                  }
              }
          }
          document.getElementById('employeeSearch').addEventListener('keyup', search());</code></pre>
  </div>
  </div>
  </p>
  
  <p>I looked in the Chrome debugger (figure 1)and can see the value I am trying to search for is in the childnode of the class I am selecting. Not sure how to access it. Appreciate any and all help, thanks. 
  <a href="https://i.stack.imgur.com/OPVPU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OPVPU.png" alt="figure1"></a> </p>