<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    .tooltip-container {
      position: relative;
      display: inline-block;
    }

    .tooltip-content {
      display: none;
      position: absolute;
      background-color: #fff;
      border: 1px solid #ccc;
      padding: 10px;
      border-radius: 5px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      z-index: 1;
    }

    .tooltip-content label {
      display: block;
      margin-bottom: 5px;
    }

    .tooltip-content input {
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 10px;
    }

    .tooltip-container:hover .tooltip-content {
      display: block;
    }
  </style>
</head>
<body>

<div class="tooltip-container">
  <button>Mostrar Formulário</button>
  <div class="tooltip-content">
    <label for="input1">Campo 1:</label>
    <input type="text" id="input1" name="input1" placeholder="Digite algo">

    <label for="input2">Campo 2:</label>
    <input type="text" id="input2" name="input2" placeholder="Digite algo">

    <button onclick="submitForm()">Enviar</button>
  </div>
</div>

<script>
  function submitForm() {
    // Aqui você pode adicionar a lógica para processar os dados do formulário
    alert("Formulário enviado!");
  }
</script>

</body>
</html>



<script>
  if (parseFloat(trSelecionado.find("td")[3].innerText.replace(/\ /g, '').replace(/\,/g, '.')) > parseFloat(adicionarQtd.value.replace(/\ /g, '').replace(/\,/g, '.'))) {
            trSelecionado.find("td")[3].innerText = parseFloat(trSelecionado.find("td")[3].innerText.replace(/\ /g, '').replace(/\,/g, '.')) - parseFloat(adicionarQtd.value.replace(/\ /g, '').replace(/\,/g, '.'));
            var clonedRow = trSelecionado.clone();
            let tabelaTr = $('#tabelaDocumentoExistenteArtigoSelecionado tbody tr');
            let saoIguais = false;
            if (tabelaTr.length > 0) {
            for (let j = 0; j < tabelaTr.length; j++) {
                if (trSelecionado.find("td")[0].innerText === tabelaTr[i].querySelectorAll("td")[0].innerText && trSelecionado.find("td")[1].innerText === tabelaTr[i].querySelectorAll("td")[1].innerText) {
                  saoIguais = true;
                  console.log("São iguais");
                } else {
                  saoIguais = false;
                  console.log("São diferentes");
                }
              }
              
            console.log("Fazer: ", tabelaTr);
            } else {
              console.log("Não tem nada")
            }

            if (saoIguais == true) {
              trSelecionado.find("td")[3].innerText = parseFloat(trSelecionado.find("td")[3].innerText.replace(/\ /g, '').replace(/\,/g, '.')) - parseFloat(adicionarQtd.value.replace(/\ /g, '').replace(/\,/g, '.'));
              //trSelecionado.find("td")[5].innerText = parseFloat(parseFloat(trSelecionado.find("td")[3].innerText.replace(/\ /g, '').replace(/\,/g, '.')) - parseFloat(trSelecionado.find("td")[4].innerText.replace(/\ /g, '').replace(/\,/g, '.'))).toFixed(2).replace(/\./g, ',').replace(/\B(?=(\d{3})+(?!\d))/g, " ");
              //clonedRow.find("td")[3].innerText = parseFloat(adicionarQtd.value.replace(/\ /g, '').replace(/\,/g, '.'));

            } else {
              $('#tabelaDocumentoExistenteArtigoSelecionado tbody').append(clonedRow);
            }


            //clonedRow.find("td")[3].innerText = parseFloat(trSelecionado.find("td")[3].innerText) + parseFloat(clonedRow.find("td")[3].innerText);


            //clonedRow.removeClass('selected');
            //trSelecionado.find("td")[5].innerText = parseFloat(parseFloat(trSelecionado.find("td")[5].innerText.replace(/\ /g, '').replace(/\,/g, '.')) - (parseFloat(adicionarQtd.value.replace(/\ /g, '').replace(/\,/g, '.')) * parseFloat(trSelecionado.find("td")[4].innerText.replace(/\ /g, '').replace(/\,/g, '.')))).toFixed(2).replace(/\./g, ',').replace(/\B(?=(\d{3})+(?!\d))/g, " ");
            //clonedRow.find("td")[5].innerText = parseFloat(parseFloat(clonedRow.find("td")[3].innerText.replace(/\ /g, '').replace(/\,/g, '.')) * parseFloat(trSelecionado.find("td")[4].innerText.replace(/\ /g, '').replace(/\,/g, '.'))).toFixed(2).replace(/\./g, ',').replace(/\B(?=(\d{3})+(?!\d))/g, " ");
          }
</script>