I want to make a custom javascript constructor with custom properties. Lets imagine of how it may look like :
var a = new MyCustomConstructor({
selector: ".demo",
html: "Hello World !",
style: {
color : "white",
background : "blue"
}
});
The above example adds the text Hello World ! to all the elements with class demo with given styles. How can I make this happen actually ? I will like to achieve it with ES5 but also ES6 where necessary but no library. Can I do it ? If yes then how ?
Thanks in advance.