1

Is this possible? Something like : Pseudo code - createElement("myCustomHTML"). And then you can style myCustomHTML in your CSS. Usage: <myCustomHTML></myCustomHTML> which would pull styling in from CSS and be used in jQuery selectors?

1 Answer 1

2

This will work fine; this is how HTML5 elements are used in older browsers.

However, IE won't apply CSS to the elements until you call document.createElement("elementName").
This is what the HTML5 Shiv does.

Sign up to request clarification or add additional context in comments.

5 Comments

Oh ok, how do i do it then? Or did i inadvertantly write it in my pseudo code?
@benhowdle: He's talking about IE6, which is (hopefully) an unsupported browser at this point.
@Josh: Actually, all IE versions, except maybe IE9.
@ben: In IE, call document.createElement("tagName") once. Then (or in real browsers), just use the element.
@SLaks: Ah, I didn't know that. My question is why not us a <div> with an id?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.