Home > Web Front-end > JS Tutorial > Good way to create a new node object (custom structure/content) with jquery_jquery

Good way to create a new node object (custom structure/content) with jquery_jquery

WBOY
Release: 2016-05-16 17:43:22
Original
1196 people have browsed it
HTML
Copy code The code is as follows:





JsBin-Online js/css debugging tool






Hello OSTools





JavaScript
Copy code The code is as follows:

//jq creates a new node object;
//For example:
var objNewDiv = $('< ;div>',{'id':'mydiv','class':'menu'});
objNewDiv.html(123456);
$('#hello').append(objNewDiv);
console.log(objNewDiv);

Result:
Good way to create a new node object (custom structure/content) with jquery_jquery
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template