Why doesn't the javascript from w3schools.com ever seem to work in Squiffy?

In w3schools.com, you can separate two words in an input like this:

<!DOCTYPE html>

<p>What is your first and last name?</p>
<input id="firstlast" name="firstlast">
<button onclick="myFunction()">Try it</button>
<p id="first"></p> 
<p id="last"></p>

function myFunction() {
  var firstlast = document.getElementById("firstlast").value;
  var first = firstlast.split(/ +/)[0];
  var last = firstlast.split(/ +/)[1];
  document.getElementById("first").innerHTML = first;
  document.getElementById("last").innerHTML = last;



Nothing remotely similar seems to work in Squiffy. Does anyone know why this is? How can I get Squiffy to do the same thing?


Log in to post a reply.