Skip to content

zendre4/js-html-element-cascading-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-fixed-header

Create fixed header in your table. Write in Vanilla JS.

Installation

Bower

bower install js-html-element-cascading-renderer

How to use

Example

Javascript

var topElement = new JSHtmlElementCascadingRenderer("div","id1");
topElement.addCssClasses(["class-1","class-2"]);
topElement.setCustomAttributes({
    'data-attribute-1':'1',
    'data-attribute-2':'2'
});



var subElement = new JSHtmlElementCascadingRenderer("span","id2");
topElement.addSubComponent(subElement);
subElement.setStyles({
    'color':'#f00',
    'display':'block'
});
subElement.addSubComponent("Hello world !");//a text inside the sub component

topElement.renderTo(document.body)//htmlElementToRender must be a valid html element 

Result

<div data-attribute-1="1" data-attribute-2="2" class="class-1 class-2" id="id1">
    <span style="color:#f00;display:block" id="id2">Hello world !</span>
</div>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published