I have a html markup like this :
<div>
<p> My name is {{ name }} </p>
<p>I learn {{ lang }} </p>
<p>I am a {{ prof }} </p>
<div>
I want a javascript function that can identify all the words inside the mustache braces and arrange them with commas. I assume it will look something like this :
arrange("div"); // name, lang, prof
// Output should not be in array
// i.e. [ name, lang, prof ]
Output may be in string ! Can this be done without any external framework ?