<p id="paragraph1">Replace this content. </p> <p id="paragraph2">Append to this content. </p> <p id="paragraph3">Prepend to this content. </p> <button onClick="demo()"> Click Me </button> <script src="https://cdn.jsdelivr.net/gh/bikibird/[email protected]/src/ishml.js"></script> <script src="https://cdn.jsdelivr.net/gh/bikibird/[email protected]/src/en-us.js"></script>
var _ = ishml.Template var myPhrase = _`Hello, ${_.cycle.shuffle("Mecury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune")}. ` myPhrase.say() console.log(myPhrase.text) console.log(myPhrase.say().text) var demo=function() { myPhrase.say().replace("#paragraph1") myPhrase.say().append("#paragraph2") myPhrase.say().prepend("#paragraph3") }