Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var div = $("<div></div>");
- $("#box").append(div);
- $("#box").append("<div></div>");
- var $div = $("<div>", {id: "foo", "class": "a"});
- $div.click(function(){ /* ... */ });
- $("#box").append($div);
- $('#box').append(
- $('<div/>')
- .attr("id", "newDiv1")
- .addClass("newDiv purple bloated")
- .append("<span/>")
- .text("hello world")
- );
- // create an element with an object literal, defining properties
- var $e = $("<div>", {id: "newDiv1", name: 'test', class: "aClass"});
- $e.click(function(){ /* ... */ });
- // add the element to the body
- $("#box").append($e);
- jQuery('<div/>', {
- "id": 'foo',
- "name": 'mainDiv',
- "class": 'wrapper',
- "click": function() {
- jQuery(this).toggleClass("test");
- }}).appendTo('selector');
- var fileImportStatus;
- $('#id').change(function(){
- if($('#id').is(':checked')){
- fileImportStatus = "<strong>ON</strong>";
- }else {
- fileImportStatus = "<strong>OFF</strong>";
- }
- });
- $('#saveBtn').click(function(){
- $('#fileImportStatusTxt').empty();
- $('#fileImportStatusTxt').append('File Import is ' + fileImportStatus);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement