Vanilla HTML+JS - Dynamic Interpolation?
问题 I know that in frameworks like Handlebars and ect. it is possible to write HTML similar to the following: <span id="logged-on-username">{{username}}</span> In this contrived example, a JS file loaded when on this page would return the value of a variable called username and interpolate it into the view template. Is anything similar possible in vanilla HTML + JS? Thanks in advance for anyone's time who happens to answer. 回答1: You mean something like this const content = { "username": "Fredy