Open theRealProHacker opened 2 years ago
We will try to implement this as close to jQuery as possible:
after
/before
: Insert after/before the elementappend
/prepend
: Insert at the end/start of the elementdata
, attr
, val
: See jq-docsdetach
+remove
: Remove from the DOMempty
: Remove all child nodeswrap
: see documentationhtml
: sets or gets the inner HTML
An author script should be able to manipulate the DOM. This includes the following actions.
class
andstyle
. Setting these should be simpler than just setting a string. For example, you could haveadd_class
,remove_class
andtoggle_class
orset_style(**kwargs)
.Important is that elements are able to know about these changes, because they might have to react. This is especially true for
ReplacedElements
andMetaElements
. E.g. astyle
element that'ssrc
is changed or aninput
that'stype
is changed.