I have a <div> tag that needs to have a "style=" inserted. I want the style to match that created with an <h3> tag. What style parameters give me the equivalent font and size. TIA.
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
For future reference (and ease) you can add an ID and a CLASS to just about any form element (html tag).
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
While some tags can have a name (like form tags), most tags can have an ID. You wouldn't name an <H3> but I just showed you why you might give it an ID. In the case of form tags, I usually give them the same name and ID.
The ID is used by the Document Object Model to identify individual page elements. You can capture it using the document.getElementById() javascript. You can also capture form elements using the document.formName.elementName code. Both load the same object into the variable.
Remember that you should not reuse IDs on a page - try to make each one unique...
BTW - if this is for that innerHTML post I answered before, another solution would have been to say
Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)
Thanks. Great explaination. If I understand, some tags can have both an 'id' and 'name'.
Indeed, this was related to the other question. So now I understand that one can put anything in the 'innerHTML' string (i.e. any valid HTML code). Cool.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.