Open alejsanc opened 3 years ago
fyi https://discourse.wicg.io/t/declarative-ish-javascript-api-for-creating-dom/2641
in that conversation they seem to be more interested in creating the document declaratively. That the "append" method returns "this" is just one way to achieve that goal. I would like to focus more not only on the "append" method returning "this" but also on having methods like "appendElement (String tag)".
in that conversation the following is given as an example:
document.body.append(
document.createElement('div').append(
document.createElement('span').append(
'hello'
),
I think that should be done in the following way:
document.body.appendElement("div").appendElement("span").appendText("hello").
It seems to me that this is very simple and could be included in the DOM API easily
Hey! The chairs noticed that this hasn't seen any recent activity and it doesn't seem like this got any implementation traction. For this kind of a proposal to move forward, it'd be good to get broader community support and implementation champions on board.
Adding a "looking for interest" label.
I think it would be convenient for the DOM API to evolve to a higher level of abstraction as some Javascript libraries allow with high level and chainable methods.
Example:
I have made this same proposition in whatwg-dom and have been recommended to do it here.