1

as mentioned in the title I need a specific javascript function to be called in html, the function changes constantly upon pressing start and it looks the following:

<dt style="width: 120px">Start 1:</dt> <dd style="margin-left: 150px">{{ start.number1 }}</dd>

{{ start.number1 }} is the function I need to be displayed in html, could you help me with that please? Thanks in advance.

1
  • You can't just have the results of a javascript function appear in html, you need to add some code in javacript which will insert the required test or html elements in the right place. If you show your current js code you may get some useful suggestions about how to do this. Commented Nov 15, 2014 at 23:32

1 Answer 1

3

Using curly brackets to bind a Javascript variable into your HTML view is something very typical of javascript frameworks that provide Data Binding such as AngularJS or EmberJS This might be what you're looking for.

There are of course other ways of doing this, such as the new Object.observe() function that's available in Chrome, but it will take a while until its widely supported.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.