Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
How do I update the value inside of a custom component in Wix?

I have a custom element that I'm using to get color input values in Wix. Currently, I have trouble getting a value from outside of the custom element to show in the custom element. For example, I want to make it so that when a user clicks on a button on my page, the custom element input value is updated. I've tried consulting the wix manual for custom elements, but nothing seems to get the value updated.

//basic-input.js

const template = document.createElement('template');
template.innerHTML = `
<!DOCTYPE html>
<html>
<body>

  <label for="ucolor">User Color Choice:</label>
  <input type="text" id="ucolor" name="ucolor" value = "802140"><br><br>

</body>
</html>
`;

class BasicInput extends HTMLElement {
  
  connectedCallback() {
    
    this.appendChild(template.content.cloneNode(true));
  
    
  }
  

  
}

window.customElements.define('basic-input', BasicInput);


Button Code

export function button124_click(event) {
    console.log($w("#basicInputCustomElement").setAttribute("input","value"))
}

And the Custom Element settings in Wix: Custom Element Attribute settings in Wix

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda