0

I am trying to just display a drop down menu using famo.us:

var selector = new Surface({
size:[200,200],
content: ' <select>
  <option value="1"> 1</option>
  <option value="2"> 2</option>
  <option value="3"> 3</option>
  </select>'
});

what is wrong in this?

1 Answers1

0

You need to add backslashes to extend the string to each next line.

Here is what that would look like..

var selector = new Surface({
size:[200,200],
content: ' <select> \
  <option value="1"> 1</option> \
  <option value="2"> 2</option> \
  <option value="3"> 3</option> \
  </select>'
});

Hope it helps!

johntraver
  • 3,612
  • 18
  • 17
  • Yup. Alternatively, the OP can also use a templating library like hogan.js, handlebars, blaze, htmlbars, ejs, etc. to set the html content in a surface. – Andrew De Andrade Jun 09 '14 at 22:11