Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. <input class="search-placeholder ml-16" type="text" name="search">
  2.  
  3. <select class="mile-counter"><option value="10">10 miles</option><option value="20">20 miles</option></select>
 <input type="text" name="location" class="location" placeholder="Enter Zip or City">
  4.  
  5. let res = response.reduce((obj, item) => {
 obj[item.subSection] = obj[item.subSection] || [];
 obj[item.subSection].push(item.name);
 return obj;
 }, {});


 // get values array and iterate 
 Object.keys(res).forEach(function(k) {
 // generate h3 ith subSection value and append
 $('div.programs').append(
 $('<div class="section">' + k + '</div>')
 //$('<h3>', {text: k})
 )
 // generate buttons and append
 .append(res[k].map(v =>
 $(`<button class="button">
 <img class="programs-icons" src="/wwwroot/images/${v}.svg" onerror="imgError(this);">
 ${v}
 </button>`)
 ))
 })
  6.  
  7. <div class="population-text">Top 10 Population</div>
  8.  
  9. {
  10. "text": "string",
  11. "attributes": [
  12. "string"
  13. ],
  14. "Population": 0
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement