delegate directive in vanilla.js