[javascript] Change span text?

Possible Duplicate:
How do I change the text of a span element in javascript

Well, I've searched a lot for the answer to this, but still I couldn't find it. What I did find didn't work.

What I'm trying to do is, basically, using JavaScript: At the browser's bar, not via Greasemonkey or something else, edit a span's text .

This' the span that contains the text I want to edit:

<span id="serverTime">5:46:40</span>

The time within is just random, don't pay attention to it, it's what I want to edit using javascript..

I'm a newbie so yeah :\

This question is related to javascript text edit html

The answer is


Replace whatever is in the address bar with this:

javascript:document.getElementById('serverTime').innerHTML='[text here]';

Example.


Examples related to javascript

need to add a class to an element How to make a variable accessible outside a function? Hide Signs that Meteor.js was Used How to create a showdown.js markdown extension Please help me convert this script to a simple image slider Highlight Anchor Links when user manually scrolls? Summing radio input values How to execute an action before close metro app WinJS javascript, for loop defines a dynamic variable name Getting all files in directory with ajax

Examples related to text

Difference between opening a file in binary vs text How do I center text vertically and horizontally in Flutter? How to `wget` a list of URLs in a text file? Convert txt to csv python script Reading local text file into a JavaScript array Python: How to increase/reduce the fontsize of x and y tick labels? How can I insert a line break into a <Text> component in React Native? How to split large text file in windows? Copy text from nano editor to shell Atom menu is missing. How do I re-enable

Examples related to edit

Android EditText view Floating Hint in Material Design How to edit/save a file through Ubuntu Terminal How do I delete an item or object from an array using ng-click? Edit In Place Content Editing Change span text? Add some word to all or some rows in Excel? Can I edit an iPad's host file? Batch / Find And Edit Lines in TXT file

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment