Update Text to Display a Variable

Hello, I have a variable that is incremented by 2 buttons on my page, and I would like a textbox to display the current value of this variable. See my code below, the buttons are incrementing the variable properly (I have checked via console.log(count)), but the textbox will not update to reflect the variable. Am I referencing something incorrectly? Thank you in advanced for your help.

var count = 1;
var display = $(‘div.widget-text-v3[data-id=“6331e4ecb480dd0037cbabb2”]’).find(‘span’);


function add() {

function subtract() {
if (count > 1) {

I solved this by manually creating a textbox in the code widget, and then passing the variable into my manually created textbox via “innerHTML”.

1 Like