0

I would like to know if it is possible to add text on html without using append. only using jquery html i tried this but it doesnt work

$('#inventoryQuantity').html(var,'text-html');
4
  • .text("text"), also why the var thing.. Commented Apr 12, 2018 at 13:27
  • sorry var = variable and no text just html Commented Apr 12, 2018 at 13:28
  • Note that var is a restricted keyword, so if you've attempted to name your variable that, then you'll likely have a syntax error to deal with Commented Apr 12, 2018 at 13:29
  • I see, well j08691's answer should be helpful then. Commented Apr 12, 2018 at 13:29

1 Answer 1

4

Yes, just use the standard JavaScript concatenator +

$('#inventoryQuantity').html(var +'text-html');
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.