
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to display JavaScript variables in an HTML page without document.write?
Use Element.innerHTML in JavaScript to display JavaScript variables in an HTML page without document.write.
You can try to work through the following code snippet −
var $myName = document.querySelector('.name'); var $jsValue = document.querySelector('.jsValue'); $myName.addEventListener('input', function(event){ $jsValue.innerHTML = $myName.value; }, false);
- Related Articles
- How to use JavaScript to redirect an HTML page?
- How to include an external JavaScript inside an HTML page?
- How to include inline JavaScript inside an HTML page?
- How to add an element horizontally in HTML page using JavaScript?
- How to Insert an Image in HTML Page?
- How to write inline JavaScript code in HTML page?
- How to redirect from an HTML page?
- How to display an image in HTML?
- How to use an animated image in HTML page?
- How to add Google map inside html page without using API key?
- How to make page links in HTML Page?
- Why prefer to put JavaScript in the footer of an HTML page?
- How to display HTML element with JavaScript?
- How to reload the current page without losing any form data with HTML?
- Place autofocus in the text box when a page gets loaded without JavaScript support in HTML?

Advertisements