jquery create element with attr code example
Example: jquery create element properties
jQuery('<div/>')
.height("100px")
.width("100px")
.css('background','chocolate')
.css('border-radius','5px')
.addClass('firstclass')
.attr('id','newdiv')
.attr('data-info','test')
.appendTo('body');