Javascript examples for String:split
Iterate over string and drop words from the end
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w w w .j a v a 2 s . c om*/ var words = "user.schedule.template.edit".split('.'); while(words.length) { document.body.innerHTML += words.join('.') + "<br>"; words.pop(); } } </script> </head> <body> </body> </html>