The problem is that the DIVS that the shekel gives me does not show its text but the block and outside the div of Category as seen in the image
Index.php
Esto esta dentro de una function yo trabajo con plantillas de php
//Dentro del cuerpo Usuario
$html .='
<div id="campoBusq"></div>
<div id="categoria">';
include("selectCategJquery.php");
$varHtml .='</div>
</div>';//Fin del Cuerpo Usuario
selectCategJquery.php
<?php
include('../configuracion/conexion.php');
?>
<?php
$consulta = "SELECT idCategoria FROM buscar_categoria";
$resultado = $conexion->query($consulta) or die("Error de busqueda o conexion");
$contador = 0;
while ($datosCateorias=$resultado->fetch_assoc() ) {
$contador++;
echo "<option class='elemento ".$contador."' iden='".$contador."'>". $datosCateorias['idCategoria']."</option>";
}
mysqli_free_result($resultado);
$conexion->close();
?>
<script>
jQuery(document).ready(function() {
$('#categoria').on('click','.elemento',function() {
var e = $(this).clone();
var identificador = $(this).attr("iden");
if($("#campoBusq").find("."+identificador).length){
}else{
$(e).appendTo('#campoBusq');
}
});
$('#campoBusq').on('click','.elemento',function() {
$(this).remove();
});
});
</script>