Mike3456 Posted April 17, 2016 Share Posted April 17, 2016 The jQuery tutorial has an example at: http://www.w3schools.com/jquery/jquery_dom_add.asp where they use this line to create a text/paragraph with jQuery: var txt2 = $("<p></p>").text("Text."); // Create text with jQuery "<p></p>" does not conform to any selector documented for jQuery or CSS. What is the logic behind it? Link to comment Share on other sites More sharing options...
Ingolme Posted April 17, 2016 Share Posted April 17, 2016 It's in jQuery's documentation right here: http://api.jquery.com/jQuery/#jQuery-html-ownerDocument It creates a node that is not attached to the DOM. 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