Error Message .innerhtml
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up document.getElementById('inner').innerHTML=“message”; is giving me an error with IE up vote 0 down vote favorite Here is the java script window.onload="test"; function test() { document.getElementById('inner').innerHTML="message"; } Here is the html page I am loading up in IE
FDM Markets Trading Platform
Login
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error message “.innerHTML is not a function” [duplicate] up vote 0 down vote favorite This question http://stackoverflow.com/questions/14369287/document-getelementbyidinner-innerhtml-message-is-giving-me-an-error-with already has an answer here: javascript TypeError: document.getElementsByTagName(“p”)[0].innerHtml is not a function 2 answers I'm trying to fill the date automatically in a table header, but all I get is ".innerHTML is not a function" I've looked everywhere, and tried put my code at the top and bottom of the page, but nothing works. Help, please! window.onload = function() { var currentTime = new Date(); var month = currentTime.getMonth() + 1; http://stackoverflow.com/questions/37951999/error-message-innerhtml-is-not-a-function var day = currentTime.getDate(); var year = currentTime.getFullYear(); document.getElementById("dated").innerHTML(month + "/" + day + "/" + year); }; javascript html share|improve this question edited Jun 21 at 18:35 Uwe Keim 22.6k25100159 asked Jun 21 at 18:30 Ender Che 31 marked as duplicate by squintjavascript Users with the javascript badge can single-handedly close javascript questions as duplicates and reopen them as needed. Jun 21 at 18:36 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 3 innerHTML is not a function; it's a string property that you can get/set. –Ates Goral Jun 21 at 18:32 2 What exactly do you mean when you say you've looked everywhere? I type "JavaScript" and the title of your question into Google, and the answer comes up immediately. –squint Jun 21 at 18:35 @AtesGoral is right. Try setting the innerHTML like so document.getElementById("dated").innerHTML = month + "/" + day + "/" + year; –Phonolog Jun 21 at 18:36 add a comment| 3 Answers 3 active oldest votes up vote 3 down vote accepted Well, as the error says, innerHTML is not a function. You can assign a value to the property, though: document.getElementById("dated").innerHTML = month + "
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more http://stackoverflow.com/questions/7938911/innerhtml-in-javascript about Stack Overflow the company Business Learn more about hiring developers or posting ads http://forums.devarticles.com/javascript-development-22/js-form-validation-with-innerhtml-443937.html with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up .innerHTML in Javascript up vote 4 down vote favorite I'm trying to validate error message a login page with a div to display the errors in , I'm using innerHTML to change the empty text in the div with the error occured , the problem is that the error msg is written and disappears just in a second here is the code
Go to Home page