7

In LWC, we usually do not create dynamic nodes this way. It is idiomatic in LWC to use a repeating template (for:each and for:item) and only change the data that drives the template, rather than clone the template itself. Here, I present what you'd do in LWC. Playground css .note { margin-bottom: 10px; background-color: yellow; width: 100px; ...


3

You can simply rewrite your jsfiddle jQuery snipper to LWC next way: <template> <div class="container" lwc:dom="manual"></div> <button onclick={onAddNoteButtonClick}>Add note</button> </template> .note { margin-bottom: 10px; background-color: yellow; width: 100px; height: 100px; } import { ...


2

In order to ensure that the link is opened in the same tab, you should use window.location.replace() See the example below: window.location.replace("http://www.w3schools.com"); Source - http://www.w3schools.com/jsref/met_loc_replace.asp


Only top voted, non community-wiki answers of a minimum length are eligible