With modern browsers, you can set the textContent
property, see Node.textContent:
var span = document.getElementById("myspan");
span.textContent = "some text";
More Related Contents:
- How to load up CSS files using Javascript?
- How do I retrieve an HTML element’s actual width and height?
- jQuery document.createElement equivalent?
- Change :hover CSS properties with JavaScript
- Capture iframe load complete event
- jQuery: how to change tag name?
- How to resize html canvas element?
- Is there a best practice for generating html with javascript
- Boolean HTML Attributes
- Maximum call stack size exceeded error
- How to show the “Are you sure you want to navigate away from this page?” when changes committed?
- Render basic HTML view?
- How to do a Jquery Callback after form submit?
- Get HTML5 localStorage keys
- Limit number of lines in textarea and Display line count using jQuery
- Why the onclick element will trigger twice for label element
- Force browser to trigger reflow while changing CSS
- How to auto-scroll to end of div when data is added? [duplicate]
- Passing a variable from node.js to html
- Value was evaluated just now with console.log on JavaScript object
- How to play wav audio byte array via javascript/html5?
- How can I convert numbers into scientific notation?
- how to display base64 encoded pdf?
- how to use jQuery ajax calls with node.js
- Is there a way to get innerText of only the top element (and ignore the child element’s innerText)?
- document.activeElement returns body in onblur handler
- How to get an element’s padding value using JavaScript?
- Connecting to remote SSH server (via Node.js/html5 console)
- True Isometric Projection with HTML5 Canvas
- Google Apps Script HTML Form