Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <script type="text/javascript"
- src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
- </script>
- <script>
- $(document).ready(function() { //se empieza a ejecutar cuando el DOM esté listo
- $.get("marcadores.xml", {}, function(xml) { //Abrimos el archivo marcadores.xml
- //El ciclo se va repetir cada vez que se encuentre la etiqueta Usuario
- $('Usuario', xml).each(function() {
- var Sector = $(this).find('Sector').text();
- console.log(Sector);
- $('<option>'+Sector+'</option>').appendTo('#Lista')
- console.log(Lista)
- })
- })
- })
- </script>
- </head>
- <body>
- <datalist id="Lista"></datalist>
- <input type="text" name="Texto" list="Lista">
- </body>
- </html>
Add Comment
Please, Sign In to add comment