Press "Enter" to skip to content

InnerHTML Example in JavaScript

Defintion :

Inner HTML is a property which is meant for displaying the html content internally within in the html tags.

Program :



      <script language=”javascript”>

                    function display()





                                  //document.write(“<h1> <center> sum=”+c+” </center> </h1>”)

                                  document.getElementById(“dd”).innerHTML=”<h1> <center>sum=”+c+”</center> </h1>”;






                                   <input type=”text” name=”t1″/> <br>

                                   <input type=”text” name=”te”/> <br>

                                   <input type=”button” value=”First Button” onClick=”display()”/>

                                   <div id=”dd”> </div>




Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *