shomeronyfsbca Posted April 8, 2019 Share Posted April 8, 2019 I am unable to display Date and Time on clicking button. Sublime Text image is attached Link to comment Share on other sites More sharing options...
Funce Posted April 8, 2019 Share Posted April 8, 2019 getElementsByTagName gets the element with the name provided., like "a" for <a> and "div" for <div class="example">. Also, if you want to create a Date, you'll need to create the object, otherwise you'll be left with the object definition to output. (Or something of the sort) You'll instead want this inside your code. document.getElementsByTagName('p')[0].innerHTML = new Date(); You can also paste code by using the code block button! So you won't need to use (very limited) attachment space putting in screenshots. Link to comment Share on other sites More sharing options...
JMRKER Posted April 11, 2019 Share Posted April 11, 2019 On 4/8/2019 at 4:39 PM, Funce said: You can also paste code by using the code block button! So you won't need to use (very limited) attachment space putting in screenshots. Plus you are relying on a very poor typist (me) to enter your less than visually optimal code to test! 😖 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now