Do you create it like this: $('<div />') or $('<div></div>')
Is that how you create an element? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looking at the jQuery source code, it looks like anything matching the regular expression
/^<(\w+)\s*\/?>(?:<\/\1>)?$/will be interpreted as a “single tag” and passed directly todocument.createElement(assuming nocontextis specified). Therefore, at least in the current implementation, there’s no difference (behavior or performance) between the various formats.