JSFiddle - React, Tailwind, and code Playground

HTML

<div id="mess">
 <h1>Bhashyam School</h1>
    <p>AC Nagar Main Road, Nellore <br/>Ho, Nellore - 524001  </p>
 <p class="tel">Telephone: +(91)-9603444376 </p>
</div>

<form name="contactform" method="post" action="http://deluxewebwise.in/lab3/send.php" onsubmit="return getChilds();">
    <p>
        <input id="box" type="text" name="telephone" placeholder="Enter Your Mobile Number. ex:988*******"/><input type="hidden" name="divcontent" id="divcontent" value="" /> 
        <button type="submit" class="button" value="Submit">Get Sms</button>
    </p>
</form>

JavaScript

function getChilds()
{
    var arr=document.getElementById('mess').childNodes, str='';
    for(var i=0; i<arr.length; i++) {
        if(arr[i].innerHTML!=undefined) {
            str+=" "+(arr[i].textContent||arr[i].innerText);
        }
    }
    document.getElementById("divcontent").value=str;
    return true;
}