StefiIOE

Untitled

Sep 3rd, 2020
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <script src="jquery-5.3.1.min.js"></script>
  7. </head>
  8. <script>
  9. $(document).ready(function () {
  10.  
  11. var dict='[{"name":"ovoshje","options":["јаболко","јагода ", "круша" ,"кајсија", "банана", ' +
  12. ',"праска", "кива", "портокал","вишна","цреша]"}]';
  13.  
  14. dict=JSON.parse(dict);
  15.  
  16. var p = $("#pole").val();
  17. for(var i = 0 ; i < dict.length ; i ++)
  18. {
  19. var predlog= $('<input>'+dict[i] + '</input>');
  20. var sel = $('<select name="+dict[i].name">').appendTo('body');
  21. $(dict[i].options).each(function () {
  22. sell.append($("<option>").attr('value',this).text(this));
  23. });
  24. }
  25.  
  26. });
  27. </script>
  28. <body>
  29. <input type="text" id="pole">
  30. </body>
  31. </html>
RAW Paste Data