How to write html code dynamically using JavaScript?

How to write html code dynamically using JavaScript?

Team Leader Asked on June 18, 2017 in JAVASCRIPT.
Add Comment
1 Answer(s)
    
    <script type="text/javascript" >
    
    function contactform() {
    
    var contactdata="Name:<input type='text' name='name'><br>Message:<br><textarea rows='3' cols='10'></textarea> <br><input type='submit' value='Submit'>";
    
    document.getElementById('display').innerHTML=contactdata;
    
    }
    
    </script>
    <form name="contact">
    
    <input type="button" value="contact" onclick="contactform()">
    
    <div id="display"></div>
    
    </form>
    
    
    Team Leader Answered on June 21, 2017.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.