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

113
Vistas
jQuery and extending built-in elements

I am just looking into extending built-in elements for the first time and have some basic questions.

Let's say I want to extend a p element, assign it a class, and make it contenteditable. Is the following correct and ready-to-use?

      customElements.define('p-edit', pedit, { extends: 'p' });

      class pedit extends HTMLParagraphElement {
        constructor() {
            
            super();
          
            this.classList.add("foo");
            this.setAttribute("contenteditable",true);
        
        }
    }
      

And would that pedit element be a valid jQuery selector? And would it be a match if the jQuery selector were 'p[contenteditable="true"]' ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Ditch Customized Built-In Elements and stick to Autonomous Elements extends HTMLElement.

Unless you want to rely on polyfills forever.

Apple has, since 2016, stated they never will implement Customized Built-In Elements in Safari.

source: https://github.com/WICG/webcomponents/issues/509

about 4 years ago · Juan Pablo Isaza Denunciar
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