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

203
Visualizações
how to get article's content when click the option?

I'm working with MVC, using RSS to get feed from wired.com . But I need when I press the options, I want the contents to appear at the bottom. but I couldn't go further than that. How can I do this?

<body>
    <div id="news"></div>
    <script>
        fetch("https://www.wired.com/feed/rss")
            .then(response => response.text())
            .then(str => new DOMParser().parseFromString(str, "text/xml"))
            .then(data => {

                console.log('data', data);
                const items = data.querySelectorAll("item");

                console.log('items', items);

                let html = '';

                html += `<select onchange="showDescription(event)">`;

                items.forEach(el => {

                    let title = el.querySelector("title").innerHTML.replace("<![CDATA[", "").replace("]]>", "");

                    const description = el.querySelector("description").innerHTML.replace("<![CDATA[", "").replace("]]>", "");

                    html += `<option value="">${title}</option>`;

               });

                html += `</select>`;
                document.getElementById("news").innerHTML = html;

            })

    </script>

</body>

After excecuting the above code I am getting the following :enter image description here

I want this one : enter image description here

Thank you for help.

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