function applyParams( obj, params ) {
for( var key in params ) {
if ( typeof params[ key ] === "object" ) {
applyParams( obj[ key ], params[ key ] );
} else {
obj[ key ] = params[ key ];
}
}
}
function create( tag, params, parent ) {
if ( !tag ) {
return 'tagName is null';
}
var nevv = document.createElement( tag );
if ( params && typeof params === "object" ) {
applyParams( nevv, params );
}
return ( parent || document.body ).appendChild( nevv );
}