I have tried some scripts but I have not tried it, I apologize if it has already been in a forum, but I looked for modal and nothing suited my need,
I have a modal inside the button Client, which upon clicking loads a table with data coming from the database, wanted to know which script to use to make this table receive click and add what was selected inside the input
<!DOCTYPE html>
<html lang="en">
<head>
<title>Modal do Vitão</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style>
.modal .modal-dialog { width: 60%; }
</style>
</head>
<body>
<div class="container">
<h2>Modal</h2>
<div class="modal fade" id="Modal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<table class="table">
<?php
include ("conn.php");
echo "<table border = 1>";
echo "<tr>";
echo "<th>Código</th>";
echo "<th>Nome Fantasia</th>";
echo "<th>Cliente</th>";
echo "<th>Código Interno</th>";
echo "<th>Endereço</th>";
echo "</tr>";
$result = "SELECT codigo, nome_fantasia, cliente, codigo_interno, nome_logr from cadcli";
$resultado = mysqli_query($conn, $result);
while($row = mysqli_fetch_assoc($resultado)) {
$codigo = $row['codigo'];
$nome_fantasia = $row['nome_fantasia'];
$cliente= $row['cliente'];
$codigo_interno = $row['codigo_interno'];
$nome_logr = $row['nome_logr'];
echo"</tr>";
echo "<td>$codigo</td>";
echo "<td>$nome_fantasia</td>";
echo "<td>$cliente</td>";
echo "<td>$codigo_interno</td>";
echo "<td>$nome_logr</td>";
echo "</tr>";
}
?>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
</div>
</div>
</div>
</div>
<button type="button" class="" data-toggle="modal" data-target="#Modal">Cliente >></button><br/>
<input type="text" name="cliente">
</div>