Skip to main content
Participant
June 4, 2022
Question

Labelling a Check Box using output from Text Input component

  • June 4, 2022
  • 1 reply
  • 99 views

Hello, 

I've started working on an like a checklist or shopping list. You write what you want into the Textinput component and when you press done it will be what the check box is called. (if that makes sense). Is there a way to do it? Thanks for any help!!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 4, 2022

if your textinput has instance name ti and your checkbox instance name is cb, you can call doneF();

 

function doneF(){
document.getElementById("cb").nextSibling.outerHTML = '<label for="cb" style="box-sizing: border-box;">'+document.getElementById("ti")+'</label>'
}