Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda