shermanDye Posted July 18, 2015 Share Posted July 18, 2015 (edited) So I am learning JavaScript, and I come across this (which is one of the first things I learned about JS from your website, thank you). The first "method", if you call it that, which you show is the .innerHTML method to change the interior of an HTML element, given a named id. I have since learned other methods to be used with it, such as .value and .style. But I have never seen a comprehensive list of all the methods that can be used with this command. Either I'm not looking in the right place (which is entirely possible), or it's just not there. Since this is supposed to be a comprehensive website for all things related to web development, I think this would be a great addition to an already great website. Edited July 18, 2015 by shermanDye Link to comment Share on other sites More sharing options...
Don E Posted July 18, 2015 Share Posted July 18, 2015 Those aren't necessarily methods but properties actually. They are properties of that particular element. An HTML element is actually an object - an object has properties and methods(functions). .innerHTML, value, etc are properties for example of a particular element that you can reference to by using document.getElementById('myElement' ); getElementById() is actually a method for the 'document' object. Link to comment Share on other sites More sharing options...
davej Posted July 19, 2015 Share Posted July 19, 2015 I think you may be looking for this... http://www.w3schools.com/jsref/default.asp Link to comment Share on other sites More sharing options...
Ingolme Posted July 19, 2015 Share Posted July 19, 2015 The getElementById() method returns an object of type HTMLElement. That object has a set of properties and methods of its own. Here is a list of them: http://www.w3schools.com/jsref/dom_obj_all.asp Link to comment Share on other sites More sharing options...
shermanDye Posted July 19, 2015 Author Share Posted July 19, 2015 Thanks Foxy Mod. That's exactly what I was looking for. It's not all in one place, but by clicking around I can find what I need when it becomes necessary. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 20, 2015 Share Posted July 20, 2015 You can also check the MDN documentation. Here's the reference for all elements:https://developer.mozilla.org/en-US/docs/Web/API/ElementAnd additional stuff for HTML elements:https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement 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